diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml new file mode 100644 index 0000000..d2ef46d --- /dev/null +++ b/.github/workflows/ci-cd.yml @@ -0,0 +1,112 @@ +name: CI/CD Pipeline + +on: + push: + branches: [main] + pull_request: + branches: [main] + workflow_dispatch: + inputs: + reason: + description: "Reason for manual trigger" + required: false + default: "Test run" + type: string + schedule: + - cron: "0 0 * * 0" # weekly on Sundays at midnight + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + ci: + name: Continuous Integration + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v6 + + - name: Setup Node.js + uses: actions/setup-node@v6 + with: + node-version: "24" + 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 simple log + run: + mkdir -p logs + echo "CI Pipelineran at ${date}">logs/pipeline.log + echo "Tests passed ">> logs/pipeline.log + + - name: Generate demo HTML page + run: + mkdir -p public +