DownloadFluID #16
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: DownloadFluID | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "30 18 * * 5" | |
# - cron: '30 18 * * 1' | |
jobs: | |
fluID_job: | |
if: github.repository_owner == 'european-modelling-hubs' | |
runs-on: ubuntu-latest | |
outputs: | |
changed_files: ${{ steps.download_fluID_data.outputs.imported_snapshot }} | |
steps: | |
# # Check if run is needed | |
# # ----------------------------- | |
# - name: Get previous workflow run | |
# id: get_previous_run | |
# if: github.event.schedule != '30 18 * * 5' | |
# uses: actions/github-script@v6 | |
# with: | |
# script: | | |
# const response = await github.rest.actions.listWorkflowRuns({ | |
# owner: context.repo.owner, | |
# repo: context.repo.repo, | |
# workflow_id: 'fluID.yml', | |
# per_page: 1, | |
# }); | |
# const lastRun = response.data.workflow_runs[0]; | |
# core.setOutput('conclusion', lastRun.conclusion || 'no_run'); | |
# - name: Cancel workflow if last run was successful (Only if not running on friday) | |
# if: ${{ github.event.schedule != '30 18 * * 5' && steps.get_previous_run.outputs.conclusion == 'success' }} | |
# run: | | |
# echo "Previous run was successful. No need to run the workflow today." | |
# exit 0 # Stop workflow run | |
# Checkout the python tools repo | |
# ------------------------------------------- | |
- name: checkout python tools repo | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
repository: 'european-modelling-hubs/hub-tools' | |
ref: 'main' | |
path: './tools/' | |
# Checkout the data repository | |
# ------------------------------------------- | |
- name: checkout data repo | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
repository: 'european-modelling-hubs/RespiCast-SyndromicIndicators' | |
ref: 'main' | |
path: './repo/' | |
# Run Pyton code | |
# ------------------------- | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- run: pip install pandas pycountry==23.12.11 | |
- name: download fluID data | |
id: download_fluID_data | |
run: | | |
python ./tools/code/import_truth_fluID_ILI_ARI.py --hub_path ./repo | |
- name: Commit data repo changes | |
uses: EndBug/add-and-commit@v7 | |
with: | |
cwd: './repo' | |
message: "Update data storage" | |
default_author: github_actions | |
push: true | |
call-persisting-wf: | |
needs: fluID_job | |
uses: european-modelling-hubs/RespiCast-SyndromicIndicators/.github/workflows/persist_changes.yml@main | |
with: | |
changes-list: ${{ needs.fluID_job.outputs.changed_files }} | |
secrets: | |
envPAT: ${{ secrets.GITHUB_TOKEN }} | |