Skip to content

Commit 69e97a8

Browse files
Update update_book.yml
1 parent 2b87eb3 commit 69e97a8

File tree

1 file changed

+10
-20
lines changed

1 file changed

+10
-20
lines changed

.github/workflows/update_book.yml

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,17 @@ jobs:
2020
with:
2121
ref: 'gh-pages'
2222

23-
- name: Copy contents of dev/ to home folder
23+
- name: Clean the site contents except for dev, pull contents of dev/ to main site
2424
run: |
25-
yes | cp -rf dev $HOME
26-
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
25+
# delete everything except the dev and .git folders
26+
find . -maxdepth 1 ! -name ".git" ! -name "dev" ! -name "." | xargs rm -rf
27+
# copy the contents of dev into the root
28+
cp -rf dev/* .
29+
30+
# Push updated website, clean out old commits
31+
- name: Update website
2932
uses: peaceiris/[email protected]
3033
with:
3134
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: checkout gh-pages
37-
uses: actions/checkout@v2
38-
with:
39-
ref: 'gh-pages'
40-
41-
- name: copy dev/ website back in
42-
run: |
43-
yes | cp -rf $HOME/dev dev
44-
45-
- name: push the result to gh-pages
46-
uses: stefanzweifel/git-auto-commit-action@v5
35+
force_orphan: true
36+
cname: python.datasciencebook.ca

0 commit comments

Comments
 (0)