Skip to content

Commit

Permalink
update target branch for TTL publication
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkralidis committed Mar 14, 2024
1 parent d975480 commit 0b49b2b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
The following GitHub Actions are in place for this repository:

- on Pull Request: test the generation of WCMP2 Codelists to TTL files
- on Commit/Push to `main` branch: generate WCMP2 Codelists to TTL files, and push to `publication` branch
- on Commit/Push to `publication` branch: publish the TTL files to the WMO Codes Registry testing environment
- on Commit/Push to `main` branch: generate WCMP2 Codelists to TTL files, and push to `gh-pages` branch
- on Commit/Push to `gh-pages` branch: publish the TTL files to the WMO Codes Registry testing environment

Edit `codelists/*.csv` files -> GitHub Pull Request (test generation) -> Merge Pull Request (generate and commit to `publication` branch) -> Publish to WMO Codes Registry testing environment
Edit `codelists/*.csv` files -> GitHub Pull Request (test generation) -> Merge Pull Request (generate and commit to `gh-pages` branch) -> Publish to WMO Codes Registry testing environment

Publication to the WMO Codes Registry operational environment is executed as a manual step.
18 changes: 11 additions & 7 deletions .github/workflows/generate-and-commit-ttl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,23 @@ jobs:
- name: Generate TTL files
run: |
python3 scripts/codelists2ttl.py
- name: checkout publication branch
- name: checkout gh-pages branch
uses: actions/checkout@v3
with:
ref: publication
- name: update publication branch and publish
ref: gh-pages
- name: update gh-pages branch and publish
run: |
mkdir /tmp/wis
mv wis/ tmp/
git checkout publication
git checkout gh-pages
git config --global user.email "[email protected]"
git config --global user.name "Tom Kralidis"
rm -rf wis/*
cp -rpf /tmp/wis/* .
git add .
git commit -am "update WMCP2 Codelists TTL files"
git push
if [[ `git status --porcelain` ]]; then
git add .
git commit -am "update WMCP2 Codelists TTL files"
git push
else
echo "No changes to push"
fi
6 changes: 3 additions & 3 deletions .github/workflows/publish-to-wmo-codes-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ env:
on:
push:
branches:
- publication
- gh-pages
paths:
- 'wis/**.ttl'

Expand All @@ -20,7 +20,7 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
ref: publication
ref: gh-pages
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
Expand All @@ -36,6 +36,6 @@ jobs:
run: |
python3 -m pip install --upgrade pip
pip3 install -r scripts/requirements.txt
- name: update publication branch and publish
- name: update gh-pages branch and publish
run: |
python3 scripts/upload_changes.py {WMO_CODES_TEST_USER_ID} {WMO_CODES_TEST_API_KEY} test /tmp/wis --status experimental

0 comments on commit 0b49b2b

Please sign in to comment.