Skip to content

Commit 5c279d5

Browse files
committed
feat: add deploy action.
1 parent 70ffab0 commit 5c279d5

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Deploy Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
12+
concurrency:
13+
group: deploy-docs
14+
cancel-in-progress: true
15+
16+
jobs:
17+
build-and-deploy:
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: 20
28+
cache: npm
29+
30+
- name: Install dependencies
31+
run: npm ci
32+
33+
- name: Prepare deploy files
34+
shell: pwsh
35+
run: ./scripts/prepare-deploy.ps1
36+
37+
- name: Build site
38+
run: npm run build
39+
40+
- name: Deploy to deployment branch
41+
uses: peaceiris/actions-gh-pages@v4
42+
with:
43+
github_token: ${{ secrets.GITHUB_TOKEN }}
44+
publish_dir: ./build
45+
publish_branch: deployment
46+
force_orphan: true
47+

0 commit comments

Comments
 (0)