Skip to content

Commit d021e1f

Browse files
authored
add patch to clean gh-pages before committing (#545)
This will address #544
1 parent 5bc7724 commit d021e1f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

.github/workflows/website.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ jobs:
9797
- name: Commit and Push
9898
if: ${{ github.event_name == 'push' && steps.check-rmd.outputs.count != 0 && github.ref != 'refs/heads/gh-pages'}}
9999
run: |
100+
# clean up gh-pages
101+
cd gh-pages
102+
git rm -rf . # remove all previous files
103+
git restore --staged . # remove things from the stage
104+
cd ..
100105
# copy everything into gh-pages site
101106
cp -r `ls -A | grep -v 'gh-pages' | grep -v '.git' | grep -v '.bundle/' | grep -v '_site'` gh-pages
102107
# move into gh-pages, add, commit, and push
@@ -105,7 +110,7 @@ jobs:
105110
git config --local user.email "actions@github.com"
106111
git config --local user.name "GitHub Actions"
107112
git add -A .
108-
git commit --allow-empty -m "[Github Actions] render website (via ${{ github.sha }}"
113+
git commit --allow-empty -m "[Github Actions] render website (via ${{ github.sha }})"
109114
git push origin gh-pages
110115
# return
111116
cd ..

0 commit comments

Comments
 (0)