Skip to content

Commit

Permalink
Be able to trigger only image regeneration or getting stats
Browse files Browse the repository at this point in the history
  • Loading branch information
kwk committed Oct 9, 2023
1 parent aeeb69f commit 357026e
Showing 1 changed file with 29 additions and 13 deletions.
42 changes: 29 additions & 13 deletions .github/workflows/update-build-time-diagrams.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,19 @@ on:
# See https://docs.github.com/en/actions/reference/events-that-trigger-workflows#schedule
- cron: "0 23 * * *"

workflow_dispatch: {}
workflow_dispatch:
inputs:
get_stats:
description: 'Get stats'
default: true
required: false
type: boolean
create_diagrams:
description: 'Create diagrams'
default: true
required: false
type: boolean


jobs:
update-build-time-diagrams:
Expand Down Expand Up @@ -52,20 +64,24 @@ jobs:
- name: Setup git config
run: |
git config --global user.name "Github Action Bot"
git config --global user.name "Github Actions Bot"
git config --global user.email "<>"
- name: "Update build stats and re-generate diagrams"
shell: bash -e {0}
run: |
main/build-stats/get-build-stats.py | tee -a gh-pages/build-stats.csv
main/build-stats/create-diagrams.py --datafile gh-pages/build-stats.csv
mv index.html gh-pages/index.html
mv fig-*.html gh-pages/
cd gh-pages
git add build-stats.csv
git add index.html fig-*.html
git commit -m "Automatically update stats and regenerated diagrams"
git push origin HEAD:gh-pages
if ${{ inputs.get_stats }}; then
main/build-stats/get-build-stats.py | tee -a gh-pages/build-stats.csv
git -C gh-pages add build-stats.csv
fi
if ${{ inputs.create_diagrams }}; then
main/build-stats/create-diagrams.py --datafile gh-pages/build-stats.csv
mv index.html gh-pages/index.html
mv fig-*.html gh-pages/
git -C gh-pages add index.html fig-*.html
fi
if [[ ${{ inputs.get_stats }} || ${{ inputs.create_diagrams }} ]]; then
cd gh-pages
git commit -m "Automatically update stats build stats"
git push origin HEAD:gh-pages
fi

0 comments on commit 357026e

Please sign in to comment.