From a2fbcc1b4161683458a23506363d6e9ad6580b0f Mon Sep 17 00:00:00 2001 From: Trevor Campbell Date: Wed, 21 Aug 2024 16:12:54 -0700 Subject: [PATCH 1/2] simpler public website update workflow --- .github/workflows/update_book.yml | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/.github/workflows/update_book.yml b/.github/workflows/update_book.yml index 4f15efbe..00eba892 100644 --- a/.github/workflows/update_book.yml +++ b/.github/workflows/update_book.yml @@ -27,27 +27,17 @@ 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 $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 folder + ls -1 --hide=dev | 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: checkout gh-pages again (to grab new orphaned upstream branch) - uses: actions/checkout@v2 - with: - ref: 'gh-pages' - - - name: copy dev/ website back in - run: | - yes | cp -rf $HOME/dev dev - - - name: push the result to gh-pages - uses: stefanzweifel/git-auto-commit-action@v5 From d1b957667e1535a1c29d4788224a86deb613645a Mon Sep 17 00:00:00 2001 From: Trevor Campbell Date: Wed, 21 Aug 2024 16:13:24 -0700 Subject: [PATCH 2/2] empty commit to trigger rebuild --- index.Rmd | 2 -- 1 file changed, 2 deletions(-) diff --git a/index.Rmd b/index.Rmd index 3f66b72d..9c4beee9 100755 --- a/index.Rmd +++ b/index.Rmd @@ -54,5 +54,3 @@ knitr::include_graphics("img/frontmatter/ds-a-first-intro-cover.jpg") This work by [Tiffany Timbers](https://www.tiffanytimbers.com/), [Trevor Campbell](https://trevorcampbell.me/), and [Melissa Lee](https://www.stat.ubc.ca/users/melissa-lee) is licensed under a [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License](http://creativecommons.org/licenses/by-nc-sa/4.0/). - -