From b1e329c693c8db804a4c8ff586b2c5dcd522eb66 Mon Sep 17 00:00:00 2001 From: Hazarkais <155266426+Hazarkais@users.noreply.github.com> Date: Tue, 23 Dec 2025 21:20:51 +0200 Subject: [PATCH 1/2] Create ci-cd.yml --- .github/workflows/ci-cd.yml | 9 +++++++++ 1 file changed, 9 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..88469a1 --- /dev/null +++ b/.github/workflows/ci-cd.yml @@ -0,0 +1,9 @@ +name: Test CI + +on: push + +jobs: + test: + runs-on: ubuntu-latest + steps: + - run: echo "CI/CD is working" From edd42d3443d936aef3be2cd0a5aba476647e7a05 Mon Sep 17 00:00:00 2001 From: Hazarkais <155266426+Hazarkais@users.noreply.github.com> Date: Tue, 23 Dec 2025 21:22:45 +0200 Subject: [PATCH 2/2] Update ci-cd.yml --- .github/workflows/ci-cd.yml | 69 ++++++++++++++++++++++++++++++++++--- 1 file changed, 65 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 88469a1..b4b6b72 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -1,9 +1,70 @@ -name: Test CI +name: CI/CD Pipeline -on: push +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +permissions: + contents: read + pages: write + id-token: write jobs: - test: + ci: + name: Continuous Integration + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "20" + cache: "npm" + + - 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 build log + run: | + mkdir -p build-logs + echo "Build timestamp: $(date)" > build-logs/build-log.txt + + - name: Upload build logs + uses: actions/upload-artifact@v4 + with: + name: build-logs + path: build-logs/ + + - name: Upload demo site + uses: actions/upload-artifact@v4 + with: + name: demo-site + path: demo/ + + cd: + name: Continuous Deployment + needs: ci + if: github.event_name == 'push' && github.ref == 'refs/heads/main' runs-on: ubuntu-latest + steps: - - run: echo "CI/CD is working" + - name: Deploy to GitHub Pages + uses: actions/deploy-pages@v4 +