From 9085991ad278b8da507ffa4e78915e5506e8d9ed Mon Sep 17 00:00:00 2001 From: Sebastian Noel Date: Fri, 27 Feb 2026 21:18:56 -0500 Subject: [PATCH 1/3] chore: added GitHub Actions CI/CD workflows --- .github/workflows/ci.yml | 44 ++++++++++++++++++++++++ .github/workflows/docker.yml | 63 ++++++++++++++++++++++++++++++++++ .github/workflows/temp.gitkeep | 0 Dockerfile | 2 +- README.md | 16 +++++++-- 5 files changed, 121 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/docker.yml delete mode 100644 .github/workflows/temp.gitkeep diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..5598859 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,44 @@ +# ============================================================================= +# CI Workflow - Continuous Integration +# Runs on all PRs and pushes to main +# ============================================================================= + +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +# Cancel in-progress runs when a new commit is pushed +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + # --------------------------------------------------------------------------- + # Lint and Build + # --------------------------------------------------------------------------- + ci: + name: Lint & Build + 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 ESLint + run: npm run lint + + - name: Build application + run: npm run build diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..4dc1814 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,63 @@ +# ============================================================================= +# Docker Build Workflow +# Verifies the Docker image builds successfully +# ============================================================================= + +name: Docker Build + +on: + push: + branches: [main] + paths: + - "Dockerfile" + - "docker-compose.yml" + - ".dockerignore" + - "package.json" + - "package-lock.json" + - "next.config.ts" + - "app/**" + - "components/**" + - "public/**" + - "styles/**" + pull_request: + branches: [main] + paths: + - "Dockerfile" + - "docker-compose.yml" + - ".dockerignore" + - "package.json" + - "package-lock.json" + - "next.config.ts" + - "app/**" + - "components/**" + - "public/**" + - "styles/**" + +# Cancel in-progress runs when a new commit is pushed +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + # --------------------------------------------------------------------------- + # Build Docker Image + # --------------------------------------------------------------------------- + docker-build: + name: Build Docker Image + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build Docker image + uses: docker/build-push-action@v6 + with: + context: . + push: false + tags: gpkweb:test + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/.github/workflows/temp.gitkeep b/.github/workflows/temp.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/Dockerfile b/Dockerfile index e7d3dd2..ead690a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # ============================================================================= # Dockerfile for GPK Website (Next.js) -# Uses multi-stage build for optimized production images (293 MB) +# Uses multi-stage build for optimized production images # ============================================================================= # ----------------------------------------------------------------------------- diff --git a/README.md b/README.md index 671ca48..95130e1 100644 --- a/README.md +++ b/README.md @@ -89,8 +89,9 @@ npm run start - `fix/mobile-view-bug` - `chore/docker-setup` - Open a Pull Request into `main`. +- GitHub Actions CI/CD runs and must pass checks. - At least 1 teammate review required before merge. -- Use squash merge for clean history. +- Use squash merge to main for clean history. ## Commit Convention @@ -110,6 +111,7 @@ Follow this commit style (examples provided): ├── public/ # Static assets ├── styles/ # Global/component styles ├── .github/ # GitHub templates/workflows +│ └── workflows/ # CI/CD pipelines ├── Dockerfile # Production container ├── docker-compose.yml # Local Docker setup ├── .dockerignore # Docker build exclusions @@ -163,8 +165,16 @@ Open [http://localhost:3000](http://localhost:3000) ## Infrastructure -- Docker files at repository root (`Dockerfile`, `.dockerignore`, `docker-compose.yml`) -- CI/CD workflows under `.github/workflows/` +### CI/CD Workflows + +GitHub Actions workflows run automatically: + +| Workflow | Trigger | What it does | +|-----------------|-----------------------------------------------|---------------------------- | +| **CI** | PRs and pushes to `main` | Runs lint and build | +| **Docker Build**| PRs/pushes affecting app code or Docker files | Verifies Docker image builds| + +View workflow runs: [Actions tab](https://github.com/GraphicsProgrammingKnights/gpkweb/actions) ## License From 74c58c0c356ceef16e4b8eacc710a4605d2236ac Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 28 Feb 2026 02:32:21 +0000 Subject: [PATCH 2/3] Initial plan From 03c44a224f183f4014f87f7487e791bb3c6c7828 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 28 Feb 2026 02:33:00 +0000 Subject: [PATCH 3/3] Add workflow file path to docker.yml paths filter Co-authored-by: sebastian-noel <179660949+sebastian-noel@users.noreply.github.com> --- .github/workflows/docker.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 4dc1814..681d5ba 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -19,6 +19,7 @@ on: - "components/**" - "public/**" - "styles/**" + - ".github/workflows/docker.yml" pull_request: branches: [main] paths: @@ -32,6 +33,7 @@ on: - "components/**" - "public/**" - "styles/**" + - ".github/workflows/docker.yml" # Cancel in-progress runs when a new commit is pushed concurrency: