Skip to content

Commit b4a08eb

Browse files
committed
GitHub pages deploy workflow
1 parent 274d56d commit b4a08eb

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: 'Deploy GitHub Pages'
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Perform Checkout
14+
uses: actions/checkout@v3
15+
16+
- name: Insert Git Hash
17+
run: |
18+
rm src/lib/GIT_VERSION.ts
19+
git rev-parse HEAD | awk '{printf("export const GIT_VERSION: string | null = \"%s\"", $0)}' >> src/lib/GIT_VERSION.ts
20+
21+
- name: Use Node.js
22+
uses: actions/setup-node@v3
23+
with:
24+
node-version: '22.x'
25+
cache: 'npm'
26+
27+
- name: Install
28+
run: npm install
29+
30+
- name: Build
31+
run: npm run build
32+
33+
- name: Deploy
34+
uses: peaceiris/actions-gh-pages@v3
35+
with:
36+
github_token: ${{ secrets.GITHUB_TOKEN }}
37+
publish_dir: ./build
38+
publish_branch: gh-pages

0 commit comments

Comments
 (0)