update-html #4
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
name: update-html | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: [main] | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set up Pandoc | |
uses: r-lib/actions/setup-pandoc@v2 | |
- name: Run build script | |
id: build | |
run: | | |
bash build.sh | |
git diff | |
if git diff --exit-code --quiet; then | |
echo "updated=0" >> $GITHUB_OUTPUT | |
else | |
echo "updated=1" >> $GITHUB_OUTPUT | |
fi | |
- name: Commit and push if changes | |
if: steps.build.outputs.updated == '1' | |
run: | | |
git commit -am "Update HTML" | |
git push |