-
Notifications
You must be signed in to change notification settings - Fork 5
77 lines (64 loc) · 2.17 KB
/
deploy.yml
File metadata and controls
77 lines (64 loc) · 2.17 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Deploy profile site to GitHub Pages
on:
push:
branches:
- web
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: web
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
run_install: false
- name: Install dependencies
run: pnpm install
- name: Build site
env:
# Optional: use GitHub Actions token for higher rate limits
# and to include private repos in stats if desired.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Default to this repo's owner as the GitHub profile target.
GITHUB_OWNER: ${{ github.repository_owner }}
GITHUB_PROFILE_TYPE: user
# Set Vite base path for GitHub Pages
VITE_BASE: ${{ endsWith(github.event.repository.name, '.github.io') && '/' || format('/{0}/', github.event.repository.name) }}
# Admin panel (route /admin) – set in repo Settings → Secrets and variables → Actions
# VITE_GITHUB_CLIENT_ID from secret (create OAuth App at github.com/settings/developers)
VITE_GITHUB_CLIENT_ID: ${{ secrets.VITE_GITHUB_CLIENT_ID }}
VITE_GITHUB_OWNER: ${{ github.repository_owner }}
VITE_GITHUB_REPO: ${{ github.event.repository.name }}
# OAuth CORS proxy – optional; add repo variable for admin login in production
VITE_GITHUB_OAUTH_PROXY_URL: ${{ vars.VITE_GITHUB_OAUTH_PROXY_URL }}
VITE_DATA_BRANCH: web
run: pnpm build
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: dist
deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4