File tree Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Original file line number Diff line number Diff line change 22name : Fetch data and update dashboard
33
44on :
5- # push:
6- # branches: [ main ]
75 schedule :
86 - cron : ' 30 14 * * *' # Daily at 14:30 UTC (9:30 EST or 10:30 EDT)
97 workflow_dispatch :
108
119jobs :
1210 build :
1311 runs-on : ubuntu-latest
12+ id : build_and_commit
13+ outputs :
14+ committed : ${{ steps.commit_and_push.outputs.committed }}
1415
1516 steps :
1617 - name : Check out repository
3031 run : python content/dashboard/dashboard.py
3132
3233 - name : Commit and push updated charts and data
34+ id : commit_and_push
3335 run : |
3436 git config user.name "github-actions[bot]"
3537 git config user.email "github-actions[bot]@users.noreply.github.com"
4042 echo "Changes detected in generated files. Committing..."
4143 git commit -m "Update dashboard with newly released data"
4244 git push
45+ echo "committed=true" >> "$GITHUB_OUTPUT"
4346 else
4447 echo "No changes detected in generated files. Nothing to commit."
48+ echo "committed=false" >> "$GITHUB_OUTPUT"
4549 fi
Original file line number Diff line number Diff line change @@ -35,9 +35,12 @@ defaults:
3535
3636jobs :
3737 # Build job
38- build :
39- # Ensure that the build job only runs for 'push', 'workflow_dispatch', or successful 'workflow_run' events
40- if : github.event_name == 'push' || github.event_name == 'workflow_dispatch' || (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
38+ build :
39+ # Ensure that the build job only runs for 'push', 'workflow_dispatch', or a successful 'workflow_run' that made a commit
40+ if : |
41+ github.event_name == 'push' ||
42+ github.event_name == 'workflow_dispatch' ||
43+ (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.jobs[0].outputs.committed == 'true')
4144 runs-on : ubuntu-latest
4245 env :
4346 HUGO_VERSION : 0.147.2
7275
7376 # Deployment job
7477 deploy :
75- if : github.event_name == 'push' || github.event_name == 'workflow_dispatch' || (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
78+ # Ensure that the deploy job only runs for 'push', 'workflow_dispatch', or a successful 'workflow_run' that made a commit
79+ if : |
80+ github.event_name == 'push' ||
81+ github.event_name == 'workflow_dispatch' ||
82+ (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.jobs[0].outputs.committed == 'true')
7683 environment :
7784 name : github-pages
7885 url : ${{ steps.deployment.outputs.page_url }}
You can’t perform that action at this time.
0 commit comments