Skip to content

Commit b249fc8

Browse files
committed
Update GitHub actions workflows
1 parent 761a410 commit b249fc8

6 files changed

Lines changed: 379 additions & 7 deletions

File tree

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ updates:
99
labels:
1010
- "type: dependencies 🔗"
1111
- "automerge 🤞"
12+
# Ignore list: pin packages that should not be updated automatically
13+
ignore:
14+
- dependency-name: "zod"
15+
update-types: ["version-update:semver-patch", "version-update:semver-minor", "version-update:semver-major"]
1216
- package-ecosystem: "github-actions"
1317
directory: "/"
1418
schedule:
Lines changed: 79 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,89 @@
1-
# Runs build and test
2-
name: CI
1+
# Runs build, unit tests, and E2E tests - gates deployment
2+
name: CI - Build & Test
3+
34
on:
45
push:
56
branches: [main]
67
pull_request:
78
branches: [main]
9+
810
jobs:
9-
build:
11+
build-and-test:
12+
name: Build and Test
1013
runs-on: ubuntu-latest
14+
1115
steps:
12-
- uses: actions/checkout@v4
13-
- uses: actions/setup-node@v4
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
1421
with:
1522
node-version: "20.x"
16-
- run: yarn install
17-
- run: yarn build
23+
cache: 'npm'
24+
25+
- name: Install dependencies
26+
run: npm ci
27+
28+
- name: Run lint
29+
run: npm run lint
30+
31+
- name: Run unit tests
32+
run: npm test -- --run
33+
34+
- name: Build project
35+
run: npm run build
36+
env:
37+
NODE_ENV: production
38+
39+
- name: Install Playwright browsers
40+
run: npx playwright install --with-deps
41+
42+
- name: Run Playwright E2E tests
43+
run: npx playwright test
44+
45+
- name: Upload Playwright report
46+
uses: actions/upload-artifact@v4
47+
if: always()
48+
with:
49+
name: playwright-report
50+
path: playwright-report/
51+
retention-days: 30
52+
53+
- name: Upload test coverage
54+
uses: actions/upload-artifact@v4
55+
if: always()
56+
with:
57+
name: test-coverage
58+
path: coverage/
59+
retention-days: 30
60+
61+
# This job will only run after build-and-test succeeds
62+
deployment-ready:
63+
name: Deployment Gate
64+
runs-on: ubuntu-latest
65+
needs: build-and-test
66+
if: github.ref == 'refs/heads/main'
67+
68+
steps:
69+
- name: All tests passed
70+
run: echo "✅ All tests passed. Deployment can proceed."
71+
deploy-to-vercel:
72+
name: Deploy to Vercel
73+
runs-on: ubuntu-latest
74+
needs: deployment-ready
75+
if: github.ref == 'refs/heads/main' && success()
76+
77+
steps:
78+
- name: Checkout repository
79+
uses: actions/checkout@v4
80+
81+
- name: Deploy to Vercel
82+
uses: amondnet/vercel-action@v25
83+
with:
84+
vercel-token: ${{ secrets.VERCEL_TOKEN }}
85+
vercel-args: '--prod'
86+
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
87+
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
88+
env:
89+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}

.github/workflows/codeql.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Security policy for GitHub Security Advisories
2+
name: CodeQL Advanced Security Scanning
3+
4+
on:
5+
push:
6+
branches: [main]
7+
pull_request:
8+
branches: [main]
9+
schedule:
10+
# Run at 6 AM UTC every Monday
11+
- cron: '0 6 * * 1'
12+
13+
jobs:
14+
analyze:
15+
name: Analyze Code
16+
runs-on: ubuntu-latest
17+
permissions:
18+
actions: read
19+
contents: read
20+
security-events: write
21+
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
language: ['javascript']
26+
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
31+
- name: Initialize CodeQL
32+
uses: github/codeql-action/init@v3
33+
with:
34+
languages: ${{ matrix.language }}
35+
queries: +security-and-quality
36+
37+
- name: Autobuild
38+
uses: github/codeql-action/autobuild@v3
39+
40+
- name: Perform CodeQL Analysis
41+
uses: github/codeql-action/analyze@v3
42+
with:
43+
category: "/language:${{ matrix.language }}"
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Dependency vulnerability scanning
2+
name: Dependency Review
3+
4+
on:
5+
pull_request:
6+
branches: [main]
7+
8+
permissions:
9+
contents: read
10+
pull-requests: write
11+
12+
jobs:
13+
dependency-review:
14+
name: Review Dependencies
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Dependency Review
21+
uses: actions/dependency-review-action@v4
22+
with:
23+
fail-on-severity: moderate
24+
comment-summary-in-pr: always

0 commit comments

Comments
 (0)