Add GitHub Actions workflow for GitHub Pages deployment
Some checks failed
Deploy to GitHub Pages / build (push) Has been cancelled
Deploy to GitHub Pages / deploy (push) Has been cancelled

- Auto-deploy on push to main branch
- Manual trigger via workflow_dispatch
- Uses Node.js 20, npm ci for reproducible builds
- Deploys dist/ folder to GitHub Pages

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
gbanyan
2025-12-15 23:30:38 +08:00
parent 820679df66
commit 41333f74ad

View File

@@ -1,21 +1,28 @@
# Deploy to GitHub Pages
name: Deploy to GitHub Pages
on:
# Runs on pushes targeting the default branch
push:
branches:
- main
branches: ["main"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
@@ -25,8 +32,11 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
node-version: "20"
cache: "npm"
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Install dependencies
run: npm ci
@@ -34,14 +44,12 @@ jobs:
- name: Build
run: npm run build
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'dist'
path: ./dist
# Deployment job
deploy:
environment:
name: github-pages