Skip to content

Commit 9979083

Browse files
authored
build: add deploy workflow (#18)
* build: add deploy workflow * comment out WIP pages * allows book.json in book building
1 parent 5bb6955 commit 9979083

File tree

3 files changed

+57
-0
lines changed

3 files changed

+57
-0
lines changed

.github/workflows/deploy-guide.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Deploy Guide to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'guide/**'
9+
- '.github/workflows/deploy-guide.yml'
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
concurrency:
18+
group: pages
19+
cancel-in-progress: false
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
container: node
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
29+
- name: Install dependencies
30+
working-directory: guide
31+
run: npm ci
32+
33+
- name: Build guide
34+
working-directory: guide
35+
run: npm run build
36+
37+
- name: Setup Pages
38+
uses: actions/configure-pages@v4
39+
40+
- name: Upload artifact
41+
uses: actions/upload-pages-artifact@v3
42+
with:
43+
path: guide/_book
44+
45+
deploy:
46+
environment:
47+
name: github-pages
48+
url: ${{ steps.deployment.outputs.page_url }}
49+
runs-on: ubuntu-latest
50+
needs: build
51+
steps:
52+
- name: Deploy to GitHub Pages
53+
id: deployment
54+
uses: actions/deploy-pages@v4

guide/.bookignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
*.js
22
*.json
3+
!book.json
34
*.mjs
45
*.cjs

guide/SUMMARY.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
* [Migrating context-local variables](05-cjs-esm-migration/migrating-context-local-variables/README.md)
2121
* [Migrating package.json](05-cjs-esm-migration/migrating-package-json/README.md)
2222

23+
<!--
2324
### Packages with a build step
2425
2526
* [Bundling](06-bundling/README.md)
@@ -38,3 +39,4 @@
3839
3940
* [Q&A](q-n-a/README.md)
4041
* [Troubleshooting](troubleshooting/README.md)
42+
* -->

0 commit comments

Comments
 (0)