From b9a761b7569048d1448d1f79e6835ca859e0d4d1 Mon Sep 17 00:00:00 2001 From: Lab User Date: Wed, 24 Dec 2025 22:20:47 +0200 Subject: [PATCH 1/2] Add CI/CD workflow --- .github/workflows/ci-cd.yml | 57 +++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/ci-cd.yml diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml new file mode 100644 index 0000000..274315f --- /dev/null +++ b/.github/workflows/ci-cd.yml @@ -0,0 +1,57 @@ +name: CI/CD + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + ci: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install dependencies + run: npm ci + - name: Run linter + run: npm run lint + - name: Check formatting + run: npm run format:check + - name: Run tests + run: npm test + - name: Build project + run: npm run build + - name: Generate log file + run: echo "$(date)" > build.log + - name: Upload build logs + uses: actions/upload-artifact@v4 + with: + name: build-logs + path: build.log + - name: Upload demo site + uses: actions/upload-artifact@v4 + with: + name: demo-site + path: demo/ + + cd: + needs: ci + if: github.ref == 'refs/heads/main' && github.event_name == 'push' + runs-on: ubuntu-latest + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - uses: actions/checkout@v4 + - name: Setup Pages + uses: actions/configure-pages@v4 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: demo/ + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file From 4ad10fbe80259372bc3d618298596d4a7dcc3c1a Mon Sep 17 00:00:00 2001 From: Lab User Date: Wed, 24 Dec 2025 22:27:03 +0200 Subject: [PATCH 2/2] Added notes about testing pipeline with PRs --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 636351e..abf6c0c 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ This repository is a **teaching project** where students learn CI/CD by: - Setting up automated testing and code quality checks - Creating and managing build artifacts - Implementing automatic deployment to GitHub Pages +- Testing the pipeline with pull requests and merges ## 📋 Requirements