Sync metadata with Datenraum #302
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: Sync metadata with Datenraum | |
on: | |
push: | |
branches: ["main"] | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
sync_datenraum: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: Install pipenv | |
run: | | |
python -m pip install --upgrade pip | |
pip install pipenv | |
- name: Install python requirements | |
run: pipenv install | |
- name: Download metadata from Serlo Metadata API | |
run: pipenv run python download_metadata.py public/serlo-metadata.json | |
- name: Validate nodes according to AMB Schema | |
run: pipenv run python validate_nodes.py | |
- name: Set credentials for Datenraum | |
run: | | |
echo "DATENRAUM_ENVIRONMENT=demo" >> "$GITHUB_ENV" | |
echo "CLIENT_ID=${{ secrets.CLIENT_ID_DEMO }}" >> "$GITHUB_ENV" | |
echo "CLIENT_SECRET=${{ secrets.CLIENT_SECRET_DEMO }}" >> "$GITHUB_ENV" | |
- name: Download metadata from Datenraum | |
run: pipenv run python download_datenraum_nodes.py public/serlo-datenraum.json | |
- name: Sync metadata from Serlo Metadata API to Datenraum | |
run: pipenv run python update_datenraum_nodes.py public/serlo-metadata.json public/serlo-datenraum.json |