Skip to content
Merged
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
44 changes: 44 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
65 changes: 65 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# =============================================================================
# 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/**"
- ".github/workflows/docker.yml"
pull_request:
branches: [main]
paths:
- "Dockerfile"
- "docker-compose.yml"
- ".dockerignore"
- "package.json"
- "package-lock.json"
- "next.config.ts"
- "app/**"
- "components/**"
- "public/**"
- "styles/**"
Comment on lines +8 to +35

Copilot AI Feb 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this workflow uses paths filters, changes to the workflow file itself won’t trigger a run on PRs/pushes. Add .github/workflows/docker.yml (and any other relevant workflow/config paths) to the paths list so updates to the workflow get validated before merge.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

- ".github/workflows/docker.yml"

# 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
Empty file removed .github/workflows/temp.gitkeep
Empty file.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -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
# =============================================================================

# -----------------------------------------------------------------------------
Expand Down
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down