Skip to content

Commit 1038f05

Browse files
DavidLiedleclaude
andcommitted
ci: github pages and CI workflows
Add a Pages deployment workflow that publishes web/ on every push to main with the contents/pages/id-token permissions and a pages concurrency group that cancels in-progress runs. Add a CI workflow that installs deps and runs node --check on every JS file under src/ plus validates the service worker and manifest in web/. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent c76349a commit 1038f05

2 files changed

Lines changed: 81 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: '20'
20+
cache: 'npm'
21+
22+
- name: Install dependencies
23+
run: npm install --ignore-scripts
24+
25+
- name: Syntax-check src/ JavaScript
26+
run: |
27+
shopt -s globstar nullglob
28+
failed=0
29+
for f in src/**/*.js; do
30+
echo "node --check $f"
31+
node --check "$f" || failed=1
32+
done
33+
exit $failed
34+
shell: bash
35+
36+
- name: Syntax-check web/sw.js
37+
run: node --check web/sw.js
38+
39+
- name: Validate web/manifest.json
40+
run: node -e "JSON.parse(require('fs').readFileSync('web/manifest.json','utf8'))"

.github/workflows/deploy-web.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Deploy web demo to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: pages
15+
cancel-in-progress: true
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Configure Pages
25+
uses: actions/configure-pages@v5
26+
27+
- name: Upload web/ as Pages artifact
28+
uses: actions/upload-pages-artifact@v3
29+
with:
30+
path: web
31+
32+
deploy:
33+
needs: build
34+
runs-on: ubuntu-latest
35+
environment:
36+
name: github-pages
37+
url: ${{ steps.deployment.outputs.page_url }}
38+
steps:
39+
- name: Deploy to GitHub Pages
40+
id: deployment
41+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)