diff --git a/.github/workflows/update_book.yml b/.github/workflows/update_book.yml index c9ff635f..b42d8a3f 100644 --- a/.github/workflows/update_book.yml +++ b/.github/workflows/update_book.yml @@ -20,22 +20,18 @@ jobs: with: ref: 'gh-pages' - - name: Copy contents of dev/ to home folder + - name: Clean the site contents except for dev, pull contents of dev/ to main site run: | - yes | cp -rf dev ${{ runner.home }} - - # Push update website to dev/ and clean out old commits - - name: Update website to contents of dev, remove all old commits and subpages + # delete everything except the dev and .git folders + find . -maxdepth 1 ! -name ".git" ! -name "dev" ! -name "." | xargs rm -rf + # copy the contents of dev into the root + cp -rf dev/* . + + # Push updated website, clean out old commits + - name: Update website uses: peaceiris/actions-gh-pages@v3.8.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: dev/ - force_orphan: true # this will clean up all previous PR previews / main branch preview - cname: datasciencebook.ca - - - name: copy dev/ website back in - run: | - yes | cp -rf ${{ runner.home }}/dev dev - - - name: push the result to gh-pages - uses: stefanzweifel/git-auto-commit-action@v5 + publish_dir: ./ + force_orphan: true + cname: python.datasciencebook.ca diff --git a/source/index.md b/source/index.md index 71d910ac..3a4ef04e 100755 --- a/source/index.md +++ b/source/index.md @@ -48,3 +48,5 @@ This work by [Tiffany Timbers](https://www.tiffanytimbers.com/), and [Lindsey Heagy](https://lindseyjh.ca/) is licensed under a [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License](http://creativecommons.org/licenses/by-nc-sa/4.0/). + +