Skip to content

Commit 91da745

Browse files
committed
ci: add GitHub Pages deploy and PR build workflows
deploy.yml builds with Vite and publishes dist/ to GitHub Pages on push to main; ci.yml runs a build check on pull requests.
1 parent d5b82b8 commit 91da745

2 files changed

Lines changed: 64 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: CI
2+
3+
# Build check for pull requests so nothing merges to main unless it builds.
4+
on:
5+
pull_request:
6+
branches: [main]
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: 20
19+
cache: npm
20+
- run: npm ci
21+
- run: npm run build

.github/workflows/deploy.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
# Allow the GITHUB_TOKEN to deploy to Pages and mint an OIDC token.
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
# One live deployment at a time; let a newer run supersede an in-progress one.
15+
concurrency:
16+
group: pages
17+
cancel-in-progress: true
18+
19+
jobs:
20+
build:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: actions/setup-node@v4
25+
with:
26+
node-version: 20
27+
cache: npm
28+
- run: npm ci
29+
- run: npm run build
30+
- uses: actions/configure-pages@v5
31+
- uses: actions/upload-pages-artifact@v3
32+
with:
33+
path: dist
34+
35+
deploy:
36+
needs: build
37+
runs-on: ubuntu-latest
38+
environment:
39+
name: github-pages
40+
url: ${{ steps.deployment.outputs.page_url }}
41+
steps:
42+
- id: deployment
43+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)