Skip to content

Commit ad78100

Browse files
update so that gh-pages is still orphaned properly
1 parent b7a7149 commit ad78100

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

.github/workflows/update_book.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,22 @@ jobs:
2727
with:
2828
ref: 'gh-pages'
2929

30-
- name: remove all pull and diff folders
30+
- name: Copy contents of dev/ to home folder
3131
run: |
32-
rm -rf pull* diff*
32+
yes | cp -rf dev ${{ runner.home }}
3333
34-
- name: copy dev website to root directory
34+
# Push update website to dev/ and clean out old commits
35+
- name: Update website to contents of dev, remove all old commits and subpages
36+
uses: peaceiris/[email protected]
37+
with:
38+
github_token: ${{ secrets.GITHUB_TOKEN }}
39+
publish_dir: dev/
40+
force_orphan: true # this will clean up all previous PR previews / main branch preview
41+
cname: datasciencebook.ca
42+
43+
- name: copy dev/ website back in
3544
run: |
36-
yes | cp -rf dev/* .
45+
yes | cp -rf ${{ runner.home }}/dev dev
3746
3847
- name: push the result to gh-pages
3948
uses: stefanzweifel/git-auto-commit-action@v5

0 commit comments

Comments
 (0)