-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
16219ec
commit 3f61e7c
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
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: | ||
- main | ||
|
||
|
||
# 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 |