diff --git a/.github/workflows/update_views_pipeline_cm_catalog.yml b/.github/workflows/update_views_pipeline_cm_catalog.yml new file mode 100644 index 0000000..2671e63 --- /dev/null +++ b/.github/workflows/update_views_pipeline_cm_catalog.yml @@ -0,0 +1,57 @@ +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 status + + - name: Clone viewsforecasting repository + run: | + git clone https://github.com/prio-data/viewsforecasting.git + cd viewsforecasting + git checkout github_workflows + # TODO: git checkout github_workflows should be removed when merged to main + + - 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 "actions@github.com" + + - name: Commit and Push Changes + run: | + cd views_pipeline + git add documentation/catalogs/cm_model_catalog.md + git commit -m "Automated changes by GitHub Actions" || echo "Nothing to commit" + git push https://${{ secrets.VIEWS_PIPELINE_ACCESS_TOKEN }}:x-oauth-basic@github.com/prio-data/views_pipeline.git + + + diff --git a/Tools/cm_querysets.py b/Tools/cm_querysets.py index 1a4ee66..8c747ff 100644 --- a/Tools/cm_querysets.py +++ b/Tools/cm_querysets.py @@ -9,6 +9,16 @@ import numpy as np from viewser import Queryset, Column +''' + + + +THIS IS SOME BLANK SPACE TO TEST THE GITHUB WORKFLOW + + + +''' + def get_cm_querysets(): diff --git a/Tools/pgm_querysets.py b/Tools/pgm_querysets.py index adcd888..3c755a4 100644 --- a/Tools/pgm_querysets.py +++ b/Tools/pgm_querysets.py @@ -9,7 +9,15 @@ import numpy as np from viewser import Queryset, Column +''' + + +THIS IS SOME BLANK SPACE TO TEST THE GITHUB WORKFLOW + + + +''' def report(df): print() print(f"A dataset with {len(df.columns)} columns, with "