Skip to content

run_orgstats

run_orgstats #72

# This workflow will install Python dependencies and run the script
name: run_orgstats
on:
workflow_dispatch: # add run button in github
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.x
uses: actions/setup-python@v5
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_KEY: ${{ secrets.ADMIN_API_TOKEN }}
PREPREFIX: ${{ secrets.PREPREFIX }}
USER_AGENT: ${{ secrets.USER_AGENT }}
MIXPANEL_API_SECRET: ${{ secrets.MIXPANEL_API_SECRET }}
MIXPANEL_PROJECT_ID: ${{ secrets.MIXPANEL_PROJECT_ID }}
MIXPANEL_TOKEN: ${{ secrets.MIXPANEL_TOKEN }}
run: |
python get_org_stats.py --output_dir=org_stats
- name: Deploy 🚀
if: always()
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: org_stats
target-folder: org_stats
- 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}}