Skip to content

Commit 05f0640

Browse files
committed
add Github action
1 parent 57b6324 commit 05f0640

File tree

3 files changed

+74
-1
lines changed

3 files changed

+74
-1
lines changed

.github/workflows/deploy.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build:
10+
name: Build Docusaurus
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: 22
19+
cache: pnpm
20+
21+
- name: Install dependencies
22+
run: pnpm install --frozen-lockfile
23+
- name: Build website
24+
run: pnpm build
25+
26+
- name: Upload Build Artifact
27+
uses: actions/upload-pages-artifact@v3
28+
with:
29+
path: build
30+
31+
deploy:
32+
name: Deploy to GitHub Pages
33+
needs: build
34+
35+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
36+
permissions:
37+
pages: write # to deploy to Pages
38+
id-token: write # to verify the deployment originates from an appropriate source
39+
40+
# Deploy to the github-pages environment
41+
environment:
42+
name: github-pages
43+
url: ${{ steps.deployment.outputs.page_url }}
44+
45+
runs-on: ubuntu-latest
46+
steps:
47+
- name: Deploy to GitHub Pages
48+
id: deployment
49+
uses: actions/deploy-pages@v4

.github/workflows/test-deploy.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Test deployment
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
test-deploy:
10+
name: Test deployment
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: 22
19+
cache: pnpm
20+
21+
- name: Install dependencies
22+
run: pnpm install --frozen-lockfile
23+
- name: Test build website
24+
run: pnpm build

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@
4242
]
4343
},
4444
"engines": {
45-
"node": ">=18.0"
45+
"node": ">=20.0"
4646
}
4747
}

0 commit comments

Comments
 (0)