-
Notifications
You must be signed in to change notification settings - Fork 0
27 lines (25 loc) · 879 Bytes
/
gh-pages.yml
File metadata and controls
27 lines (25 loc) · 879 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
name: Publish To GitHub Pages
on:
workflow_dispatch:
jobs:
build_and_publish:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Clean cached clones
run: npm run gh-pages-clean
- name: Publish to GitHub Pages
run: |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
VITE_GIT_COMMIT=$(git rev-parse --short HEAD) BASE_URL="https://${GITHUB_REPOSITORY%/*}.github.io/${GITHUB_REPOSITORY#*/}" npm run build
npm run gh-pages -- -d build -u "github-actions-bot <support+actions@github.com>"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}