Skip to content

Commit 98484c5

Browse files
committed
ci: auto-publish book to gh-pages on push to main
1 parent 5ea657e commit 98484c5

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Publish book
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch: {}
7+
8+
permissions:
9+
contents: write
10+
11+
concurrency:
12+
group: publish-gh-pages
13+
cancel-in-progress: false
14+
15+
jobs:
16+
publish:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version-file: .nvmrc
24+
25+
- name: Install dependencies
26+
run: npm ci
27+
28+
- name: Build book
29+
run: npm run build
30+
31+
- name: Deploy to gh-pages
32+
uses: peaceiris/actions-gh-pages@v4
33+
with:
34+
github_token: ${{ secrets.GITHUB_TOKEN }}
35+
publish_dir: ./_book
36+
commit_message: "Publish from ${{ github.sha }}"

0 commit comments

Comments
 (0)