Update UN population data #4
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 UN population data | |
on: | |
schedule: | |
- cron: "7 1 15 1,5,9 *" | |
push: | |
branches: | |
- main | |
jobs: | |
build_catalog: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
- name: Setup Miniconda | |
uses: conda-incubator/setup-miniconda@v2.0.1 | |
with: | |
activate-environment: undata-env | |
environment-file: environment.yml | |
python-version: 3.11 | |
auto-activate-base: false | |
- name: Run python script | |
working-directory: ./src | |
shell: bash -l {0} | |
run: | | |
python fetch_un_data.py ${{ secrets.UN_API_TOKEN }} | |
- name: Commit new changes and update tag | |
working-directory: ./ | |
shell: bash -l {0} | |
run: | | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
git add -A | |
git commit --allow-empty -m "Update UN data on on $(date +'%Y-%m-%d')" | |
git push | |
git tag -a $(date +'%Y-%m-%d') -m "Update UN data on $(date +'%Y-%m-%d')" |