Skip to content

Commit ea1942d

Browse files
committed
gh
1 parent 932d08d commit ea1942d

File tree

2 files changed

+87
-0
lines changed

2 files changed

+87
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
# Review gh actions docs if you want to further define triggers, paths, etc
8+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
9+
10+
defaults:
11+
run:
12+
working-directory: ./website
13+
14+
jobs:
15+
build:
16+
name: Build Docusaurus
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version: 20
25+
# cache: yarn
26+
27+
- name: Install dependencies
28+
run: yarn install --frozen-lockfile
29+
- name: Build website
30+
run: yarn build
31+
32+
- name: Upload Build Artifact
33+
uses: actions/upload-pages-artifact@v3
34+
with:
35+
path: website/build
36+
37+
deploy:
38+
name: Deploy to GitHub Pages
39+
needs: build
40+
41+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
42+
permissions:
43+
pages: write # to deploy to Pages
44+
id-token: write # to verify the deployment originates from an appropriate source
45+
46+
# Deploy to the github-pages environment
47+
environment:
48+
name: github-pages
49+
url: ${{ steps.deployment.outputs.page_url }}
50+
51+
runs-on: ubuntu-latest
52+
steps:
53+
- name: Deploy to GitHub Pages
54+
id: deployment
55+
uses: actions/deploy-pages@v4
56+

.github/workflows/test-deploy.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Test deployment
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
# Review gh actions docs if you want to further define triggers, paths, etc
8+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
9+
10+
defaults:
11+
run:
12+
working-directory: ./website
13+
14+
jobs:
15+
test-deploy:
16+
name: Test deployment
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version: 20
25+
# cache: yarn
26+
27+
- name: Install dependencies
28+
run: yarn install --frozen-lockfile
29+
- name: Test build website
30+
run: yarn build
31+

0 commit comments

Comments
 (0)