Skip to content

Commit a9e1d87

Browse files
committed
fix: publish book on main only
1 parent 3d38f3f commit a9e1d87

File tree

1 file changed

+51
-53
lines changed

1 file changed

+51
-53
lines changed

.github/workflows/book.yml

Lines changed: 51 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,56 @@
11
name: book
22

33
on:
4-
push:
5-
branches: [main]
6-
pull_request:
7-
branches: [main]
8-
paths:
9-
- "book/**"
10-
merge_group:
4+
push:
5+
branches: [main]
6+
paths:
7+
- "book/**"
8+
merge_group:
119

1210
jobs:
13-
build:
14-
name: Build Docusaurus
15-
runs-on: ubuntu-latest
16-
steps:
17-
- uses: actions/checkout@v4
18-
with:
19-
fetch-depth: 0
20-
- uses: actions/setup-node@v4
21-
with:
22-
node-version: 18
23-
24-
- name: Install dependencies
25-
run: cd book && yarn install --frozen-lockfile
26-
- name: Build website
27-
run: |
28-
cd book
29-
yarn build-api
30-
mv ../target/doc ./static/api
31-
mv ./static/api/static.files/* ./static/api
32-
rmdir ./static/api/static.files
33-
yarn build-book
34-
35-
- name: Upload Build Artifact
36-
uses: actions/upload-pages-artifact@v3
37-
with:
38-
path: book/build
39-
40-
deploy:
41-
name: Deploy to GitHub Pages
42-
needs: build
43-
44-
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
45-
permissions:
46-
pages: write # to deploy to Pages
47-
id-token: write # to verify the deployment originates from an appropriate source
48-
49-
# Deploy to the github-pages environment
50-
environment:
51-
name: github-pages
52-
url: ${{ steps.deployment.outputs.page_url }}
53-
54-
runs-on: ubuntu-latest
55-
steps:
56-
- name: Deploy to GitHub Pages
57-
id: deployment
58-
uses: actions/deploy-pages@v4
11+
build:
12+
name: Build Docusaurus
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: 18
21+
22+
- name: Install dependencies
23+
run: cd book && yarn install --frozen-lockfile
24+
- name: Build website
25+
run: |
26+
cd book
27+
yarn build-api
28+
mv ../target/doc ./static/api
29+
mv ./static/api/static.files/* ./static/api
30+
rmdir ./static/api/static.files
31+
yarn build-book
32+
33+
- name: Upload Build Artifact
34+
uses: actions/upload-pages-artifact@v3
35+
with:
36+
path: book/build
37+
38+
deploy:
39+
name: Deploy to GitHub Pages
40+
needs: build
41+
42+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
43+
permissions:
44+
pages: write # to deploy to Pages
45+
id-token: write # to verify the deployment originates from an appropriate source
46+
47+
# Deploy to the github-pages environment
48+
environment:
49+
name: github-pages
50+
url: ${{ steps.deployment.outputs.page_url }}
51+
52+
runs-on: ubuntu-latest
53+
steps:
54+
- name: Deploy to GitHub Pages
55+
id: deployment
56+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)