Skip to content

build

build #1181

Workflow file for this run

name: Build
on:
push:
branches:
- dev
workflow_dispatch: # for triggering builds manually
repository_dispatch:
types:
- build
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout this repo
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Set up Python 3.7
uses: actions/setup-python@v4
with:
python-version: 3.7
- uses: actions/cache@v3
name: Cache dependencies
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Fetch data
run: ./fetch_data.sh
- name: Fetch stats
run: |
mkdir out
./get_stats.sh
- name: Make plots
run: python plots.py
- name: Build CSV output
run: python make_csv.py
- name: Build HTML output
run: python make_html.py
- name: Delete files
run: rm -rf data stats-calculated
- name: Deploy (production) 🚀
if: github.ref == 'refs/heads/main'
uses: JamesIves/github-pages-deploy-action@v4
with:
git-config-name: Code for IATI bot
git-config-email: [email protected]
token: ${{ secrets.TOKEN }}
repository-name: codeforIATI/analytics-public
branch: gh-pages
folder: out
clean: true
silent: true
single-commit: true
- name: Set CNAME (dev)
if: github.ref == 'refs/heads/dev'
run: echo "analytics-dev.codeforiati.org" > out/CNAME
- name: Deploy (dev) 🚀
if: github.ref == 'refs/heads/dev'
uses: JamesIves/github-pages-deploy-action@v4
with:
git-config-name: Code for IATI bot
git-config-email: [email protected]
token: ${{ secrets.TOKEN }}
repository-name: codeforIATI/analytics-dev
branch: gh-pages
folder: out
clean: true
silent: true
single-commit: true