feat: add GitHub Pages workflow for automatic deployment on version tag push

This commit is contained in:
HouYunFei
2026-07-05 16:51:27 +08:00
parent 0b69dfce46
commit ca5faa1f4e
5 changed files with 75 additions and 23 deletions
+52
View File
@@ -0,0 +1,52 @@
name: GitHub Pages
on:
push:
tags: ["v*"]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- name: Install dependencies
working-directory: web
run: bun install --frozen-lockfile
- name: Build
working-directory: web
env:
VITE_BASE: /${{ github.event.repository.name }}/
run: bun run build
- name: Add SPA fallback
run: cp web/dist/index.html web/dist/404.html
- uses: actions/configure-pages@v5
- uses: actions/upload-pages-artifact@v3
with:
path: web/dist
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4