mirror of
https://github.com/tiennm99/caro.git
synced 2026-05-27 18:22:36 +00:00
e8c08139db
- Replace outdated Build.yml (v2 actions, JDK 1.8, 3-OS matrix) with modern workflow (v4 actions, JDK 21, single ubuntu runner) - Add separate web client build job - Add deploy-pages.yml for auto-deploying web-client to GitHub Pages on push to master (web-client/** changes only) - Set Vite base path to /caro/ for GitHub Pages compatibility
49 lines
981 B
YAML
49 lines
981 B
YAML
name: Deploy Web Client to GitHub Pages
|
|
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
paths:
|
|
- 'web-client/**'
|
|
- '.github/workflows/deploy-pages.yml'
|
|
|
|
permissions:
|
|
contents: read
|
|
pages: write
|
|
id-token: write
|
|
|
|
concurrency:
|
|
group: pages
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: web-client
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
cache: npm
|
|
cache-dependency-path: web-client/package-lock.json
|
|
- run: npm ci
|
|
- run: npm run build
|
|
- uses: actions/upload-pages-artifact@v3
|
|
with:
|
|
path: web-client/dist
|
|
|
|
deploy:
|
|
name: 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
|