Skip to content

Run Ukraine

Run Ukraine #1868

# This workflow will install Python dependencies and run the script
name: Run Ukraine
on:
workflow_dispatch: # add run button in github
schedule:
- cron: '30 */8 * * *'
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run script
env:
HDX_SITE: ${{ secrets.HDX_SITE }}
PREPREFIX: ${{ secrets.PREPREFIX }}
USER_AGENT: ${{ secrets.USER_AGENT }}
GSHEET_AUTH: ${{ secrets.GSHEET_AUTH }}
UPDATESHEETS: ${{ secrets.UPDATESHEETS }}
run: |
python run.py --what=ukraine
cp errors.log output
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: output_ukraine
target-folder: ukraine
- name: Send mail
if: failure()
uses: dawidd6/action-send-mail@v3
with:
server_address: ${{secrets.EMAIL_SERVER}}
server_port: ${{secrets.EMAIL_PORT}}
username: ${{secrets.EMAIL_USERNAME}}
password: ${{secrets.EMAIL_PASSWORD}}
subject: "FAILED: ${{github.repository}} run job"
body: GitHub Actions run job for ${{github.repository}} failed!
to: ${{secrets.EMAIL_LIST}}
from: ${{secrets.EMAIL_FROM}}
content_type: text/html