Collect quarterly metrics #46
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: Collect quarterly metrics | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- '.github/workflows/metrics.yml' | |
- 'gts_regional_metrics.py' | |
- 'btn_metrics.py' | |
- 'gts_atn_metrics.py' | |
schedule: | |
- cron: "0 12 5 * *" | |
workflow_dispatch: | |
jobs: | |
scheduled: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Setup Micromamba | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
init-shell: bash | |
environment-file: environment.yml | |
- name: echo secrets into a file | |
shell: bash -l {0} | |
env: | |
CDMO_KEY : ${{ secrets.CDMO_KEY }} | |
CDMO_NAME : ${{ secrets.CDMO_NAME }} | |
run: | | |
echo "CDMO_NAME = \"${CDMO_NAME}\"" > config.py | |
echo "CDMO_KEY = \"${CDMO_KEY}\"" >> config.py | |
- name: Collect quarterly GTS and BTN metrics | |
shell: bash -l {0} | |
run: | | |
python btn_metrics.py | |
python gts_regional_metrics.py | |
python gts_atn_metrics.py | |
- name: Commit and push if it changed | |
run: | | |
git config user.name "Automated" | |
git config user.email "[email protected]" | |
git add -A | |
timestamp=$(date -u) | |
git commit -m "Latest data: ${timestamp}" || exit 0 | |
git push |