forked from carpentries/styles
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add patch to clean gh-pages before committing
This will address carpentries#544
- Loading branch information
Showing
1 changed file
with
6 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,6 +97,11 @@ jobs: | |
- name: Commit and Push | ||
if: ${{ github.event_name == 'push' && steps.check-rmd.outputs.count != 0 && github.ref != 'refs/heads/gh-pages'}} | ||
run: | | ||
# clean up gh-pages | ||
cd gh-pages | ||
git rm -rf . # remove all previous files | ||
git restore --staged . # remove things from the stage | ||
cd .. | ||
# copy everything into gh-pages site | ||
cp -r `ls -A | grep -v 'gh-pages' | grep -v '.git' | grep -v '.bundle/' | grep -v '_site'` gh-pages | ||
# move into gh-pages, add, commit, and push | ||
|
@@ -105,7 +110,7 @@ jobs: | |
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Actions" | ||
git add -A . | ||
git commit --allow-empty -m "[Github Actions] render website (via ${{ github.sha }}" | ||
git commit --allow-empty -m "[Github Actions] render website (via ${{ github.sha }})" | ||
git push origin gh-pages | ||
# return | ||
cd .. | ||
|