Skip to content

Commit

Permalink
Only push or publish if the dashboard was updated
Browse files Browse the repository at this point in the history
  • Loading branch information
gadenbuie committed Oct 31, 2023
1 parent 3ff1f26 commit c5a293d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/build-dash.yaml
Original file line number Diff line number Diff line change
@@ -44,7 +44,15 @@ jobs:
- name: Build Pipeline and Dashboard
run: Rscript -e 'targets::tar_make()'

- name: Was the dashboard updated?
id: dashboard-updated
run: |
if [[ $(git status --porcelain -- index.html index_files/) ]]; then
echo "has_update=true" >> "$GITHUB_OUTPUT"
fi
- name: Push Built Dashboard
if: steps.dashboard-updated.outputs.has_update == 'true'
run: |
git config --global user.name 'gha update bot'
git config --global user.email 'gadenbuie@users.noreply.github.com'
@@ -53,6 +61,7 @@ jobs:
git push
- name: Publish to Quarto Pub
if: steps.dashboard-updated.outputs.has_update == 'true'
uses: quarto-dev/quarto-actions/publish@v2
with:
target: quarto-pub

0 comments on commit c5a293d

Please sign in to comment.