From 548b80760c012af6b65c8b93a44b1b086281ff4e Mon Sep 17 00:00:00 2001 From: phpproject2023 Date: Tue, 23 Dec 2025 18:23:38 +0200 Subject: [PATCH] added the ci cd yml file --- .github/workflows/ci-cd-pip.yml | 79 +++++++++++++++++++++++++++++++++ README.md | 2 + 2 files changed, 81 insertions(+) create mode 100644 .github/workflows/ci-cd-pip.yml diff --git a/.github/workflows/ci-cd-pip.yml b/.github/workflows/ci-cd-pip.yml new file mode 100644 index 0000000..b1ba701 --- /dev/null +++ b/.github/workflows/ci-cd-pip.yml @@ -0,0 +1,79 @@ +name: CI/CD Pipeline + +on: + push: + branches: [main] + pull_request: + branches: [main] + +permissions: + contents: read + pages: write + id-token: write + +jobs: + ci: + name: CI + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Setup Node.js + uses: actions/setup-node@v6 + 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 logs + echo "Build completed at $(date)" > logs/build.log + - name: Upload build logs + uses: actions/upload-artifact@v6 + with: + name: build-logs + path: logs/ + + - name: Upload demo site + uses: actions/upload-artifact@v6 + with: + name: demo-site + path: demo/ + + cd: + name: CD + needs: ci + runs-on: ubuntu-latest + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + + steps: + - name: Download demo artifact + uses: actions/download-artifact@v7 + with: + name: demo-site + path: demo + + - name: Upload Pages artifact + uses: actions/upload-pages-artifact@v3 + with: + path: demo + + - name: Deploy to GitHub Pages + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/README.md b/README.md index 636351e..aecf837 100644 --- a/README.md +++ b/README.md @@ -251,3 +251,5 @@ This project is open source and available for educational purposes. - [GitHub Pages Documentation](https://docs.github.com/en/pages) - [ESLint](https://eslint.org/) - [Prettier](https://prettier.io/) + +#was here \ No newline at end of file