update WCMP2 records 2024-11-21 #19
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: Validate and publish WCMP2 discovery metadata | |
env: | |
CENTRE_ID: ca-eccc-msc | |
PYWIS_PUBSUB_BROKER_URL: ${{ secrets.PYWIS_PUBSUB_BROKER_URL }} | |
on: | |
push: | |
branches: | |
- 'gh-pages' | |
jobs: | |
main: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.10"] | |
steps: | |
- name: checkout gh-pages branch | |
uses: actions/checkout@master | |
with: | |
ref: gh-pages | |
- uses: actions/setup-python@v5 | |
name: Setup Python ${{ matrix.python-version }} | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install requirements | |
run: | | |
python3 -m pip install --upgrade pip | |
pip3 install https://github.com/wmo-im/pywcmp/archive/master.zip | |
pip3 install https://github.com/wmo-im/pywis-pubsub/archive/main.zip | |
- name: Cache WCMP2 schemas for validation | |
run: | | |
pywcmp bundle sync | |
- name: Validate WCMP2 records | |
run: | | |
bash validate-wcmp2.sh | |
- name: Publish WNMs of WCMP2 records | |
run: | | |
for i in metadata/*.json; do pywis-pubsub publish --topic origin/a/wis2/${CENTRE_ID}/metadata --config config/pywis-pubsub-publish.yml -u https://eccc-msc.github.io/msc-wis2node/$i -i `cat /proc/sys/kernel/random/uuid` -op update -v DEBUG; done |