Skip to content

Commit 8e31f32

Browse files
update so that gh-pages is still orphaned properly
1 parent 2dba63e commit 8e31f32

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

.github/workflows/update_book.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,22 @@ jobs:
2020
with:
2121
ref: 'gh-pages'
2222

23-
- name: remove all pull and diff folders
23+
- name: Copy contents of dev/ to home folder
2424
run: |
25-
rm -rf pull* diff*
25+
yes | cp -rf dev ${{ runner.home }}
2626
27-
- name: copy dev website to root directory
27+
# Push update website to dev/ and clean out old commits
28+
- name: Update website to contents of dev, remove all old commits and subpages
29+
uses: peaceiris/[email protected]
30+
with:
31+
github_token: ${{ secrets.GITHUB_TOKEN }}
32+
publish_dir: dev/
33+
force_orphan: true # this will clean up all previous PR previews / main branch preview
34+
cname: datasciencebook.ca
35+
36+
- name: copy dev/ website back in
2837
run: |
29-
yes | cp -rf dev/* .
38+
yes | cp -rf ${{ runner.home }}/dev dev
3039
3140
- name: push the result to gh-pages
3241
uses: stefanzweifel/git-auto-commit-action@v5
33-

0 commit comments

Comments
 (0)