Update views_pipeline on Changes in cm_querysets.py and pgm_querysets.py #15
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: Update views_pipeline on Changes in cm_querysets.py and pgm_querysets.py | |
# Trigger on file changes in viewsforecasting | |
on: | |
push: | |
branches: | |
- main | |
- github_workflows # TODO: remove when merge to main | |
paths: | |
- Tools/cm_querysets.py | |
- Tools/pgm_querysets.py | |
workflow_dispatch: # enables manual triggering | |
jobs: | |
modify-views_pipeline: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout viewsforecasting repository | |
uses: actions/checkout@v3 | |
with: | |
repository: prio-data/viewsforecasting | |
token: ${{ secrets.VIEWS_PIPELINE_ACCESS_TOKEN }} | |
- name: Clone views_pipeline repository | |
run: | | |
git clone https://github.com/prio-data/views_pipeline.git | |
cd views_pipeline | |
git checkout create_cm_catalog_01 | |
- name: Clone viewsforecasting repository | |
run: | | |
cd views_pipeline | |
git clone https://github.com/prio-data/viewsforecasting.git ../viewsforecasting | |
git status | |
# TODO: this step should be removed when merged to main | |
- name: Checkout github_workflows branch in viewsforecasting | |
run: | | |
cd ../viewsforecasting | |
git status | |
git checkout github_workflows | |
git status | |
- name: Run Python script | |
run: | | |
cd views_pipeline | |
git status | |
python documentation/catalogs/generate_links_to_querysets.py | |
- name: Configure Git | |
run: | | |
git config --global user.name "GitHub Actions" | |
git config --global user.email "[email protected]" | |
- name: Commit and Push Changes | |
run: | | |
cd views_pipeline | |
git status | |
git add documentation/catalogs/cm_model_catalog.md | |
git commit -m "Automated changes by GitHub Actions" | |
git push https://${{ secrets.VIEWS_PIPELINE_ACCESS_TOKEN }}:[email protected]/prio-data/views_pipeline.git create_cm_catalog_01 | |