Files
hapi/.github/workflows/webapp.yml
T
weishu 1a6099cd6f ci: add GitHub Pages deployment workflow for web app
Adds automated deployment to GitHub Pages with custom domain app.hapi.run, and updates vite.config.ts to support dynamic base URL via VITE_BASE_URL environment variable
2025-12-29 09:30:53 +08:00

49 lines
1.2 KiB
YAML

name: Deploy Web App to GitHub Pages
on:
push:
branches:
- main
paths:
- 'web/**'
- '.github/workflows/webapp.yml'
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- run: bun install
- name: Build web app
run: bun run --cwd web build
- name: Add CNAME for custom domain
run: echo "app.hapi.run" > web/dist/CNAME
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
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:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4