Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down