Skip to content

Commit 1317c6d

Browse files
add main deploy preview; use keep_files in build_book
1 parent 70b7d19 commit 1317c6d

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

.github/workflows/build_book.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ jobs:
2929
with:
3030
github_token: ${{ secrets.GITHUB_TOKEN }}
3131
publish_dir: source/_build/html
32-
force_orphan: true
3332
cname: python.datasciencebook.ca
33+
keep_files: true
34+
# force_orphan: true # once peaceiris updates to v4, change this to true and keep_files: true for the PR / main branch deploy previews
3435

3536

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Rebuild and deploy dev version of book to gh-pages branch in dev/ folder
2+
on:
3+
push:
4+
branches:
5+
- main
6+
paths:
7+
- source/**
8+
9+
jobs:
10+
deploy-book:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
packages: write
15+
16+
steps:
17+
- name: checkout
18+
uses: actions/checkout@v2
19+
with:
20+
ref: 'main'
21+
22+
- name: Build the book
23+
run: |
24+
./build_html.sh
25+
26+
# Push the book's HTML to github-pages
27+
- name: GitHub Pages action
28+
uses: peaceiris/[email protected]
29+
with:
30+
github_token: ${{ secrets.GITHUB_TOKEN }}
31+
publish_dir: source/_build/html
32+
keep_files: true
33+
destination_dir: dev
34+
# force_orphan: true # once peaceiris updates to v4, change this to true and keep_files: true for the PR / main branch deploy previews
35+
36+
37+

0 commit comments

Comments
 (0)