mirror of
https://github.com/tiennm99/loto.git
synced 2026-09-04 00:17:28 +00:00
ci: bring back GitHub Pages auto-deploy
.github/workflows/deploy-github-pages.yml runs `npm run build:gh` on push to main and uploads build/ via actions/upload-pages-artifact@v3 + actions/deploy-pages@v4. The build:gh script sets BUILD_PROFILE=gh, which switches svelte.config.js basePath to /loto so assets resolve under tiennm99.github.io/loto. Cloudflare Pages keeps deploying in parallel via the CF dashboard (npm run build, root basePath, loto.miti99.com). Two URLs, no conflict.
This commit is contained in:
+41
@@ -0,0 +1,41 @@
|
||||
name: Deploy to GitHub Pages
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
concurrency:
|
||||
group: github-pages
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: npm
|
||||
- run: npm ci
|
||||
- run: npm run build:gh
|
||||
- uses: actions/configure-pages@v5
|
||||
- uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
path: build
|
||||
|
||||
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
|
||||
Reference in New Issue
Block a user