update html tables #2
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 tables | |
# Controls when the action will run. Workflow runs when manually triggered using the UI | |
# or API. | |
on: | |
workflow_dispatch: | |
push: | |
paths: | |
- 'CORDEX-CMIP6_source_id.json' | |
- 'CORDEX-CMIP6_institution_id.json' | |
branches: | |
- emulators | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
update_html: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
- name: checkout cordex-cv | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r scripts/requirements.txt | |
- name: Update html tables | |
run: | | |
cd scripts | |
pip install -e . --no-deps; cd .. | |
python scripts/create-html-datatables.py | |
- name: Check if there are any changes | |
id: verify_diff | |
run: | | |
git diff docs/ --quiet . || echo "changed=true" >> $GITHUB_OUTPUT | |
- name: Commit and push | |
if: steps.verify_diff.outputs.changed == 'true' | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
#(pre-commit run --all-files) || true | |
git commit docs/ -m "html update" | |
git status | |
git push |