get-survstat-data #782
This file contains hidden or 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: "get-survstat-data" | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "10 8,13,18 * * 1,4" | |
| jobs: | |
| get-survstat-data: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@main | |
| - name: Setup Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.x' | |
| - name: Install requirements | |
| run: | | |
| pip install numpy pandas pathlib requests epiweeks | |
| - name: Get survstat data | |
| env: | |
| TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| cd ./code | |
| python ./get_survstat_data.py | |
| - name: Commit files | |
| env: | |
| AUTH: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| git remote rm origin | |
| git remote add origin https://${AUTH}@github.com/KITmetricslab/RESPINOW-Data.git > /dev/null 2>&1 | |
| git pull origin main | |
| git add --all | |
| git commit --allow-empty -m "Get survstat data" | |
| - name: Push changes | |
| run: | | |
| git push --quiet --set-upstream origin HEAD:main | |
| echo "pushed to github" |