Skip to content

Commit

Permalink
added update html workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
larsbuntemeyer committed Apr 12, 2024
1 parent 16219ec commit 3f61e7c
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/update-html.yaml
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

0 comments on commit 3f61e7c

Please sign in to comment.