mirror of
https://github.com/tiennm99/pikachu.git
synced 2026-05-25 15:59:16 +00:00
214c305e83
- Add deploy.yml: test → build → deploy pipeline - Update next.config.mjs with basePath/assetPrefix for /pikachu/ subpath - Uses actions/deploy-pages for GitHub Pages deployment
49 lines
965 B
YAML
49 lines
965 B
YAML
name: Deploy to GitHub Pages
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
pages: write
|
|
id-token: write
|
|
|
|
concurrency:
|
|
group: pages
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
test:
|
|
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 test
|
|
|
|
build-deploy:
|
|
needs: test
|
|
runs-on: ubuntu-latest
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: npm
|
|
- run: npm ci
|
|
- run: npm run build-nolog
|
|
- uses: actions/configure-pages@v5
|
|
- uses: actions/upload-pages-artifact@v3
|
|
with:
|
|
path: dist
|
|
- id: deployment
|
|
uses: actions/deploy-pages@v4
|