-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (61 loc) · 1.75 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: deploy
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [master]
workflow_dispatch:
schedule:
- cron: '*/15 * * * *'
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Install locale
run: |
sudo locale-gen pt_PT.UTF-8
sudo update-locale LANG=pt_PT.UTF-8
- name: Checkout
uses: actions/checkout@v2.3.1
with:
persist-credentials: false
- name: Cache vendored data
uses: actions/cache@v2
with:
path: vendor
key: vendor-data
- name: Download COVID19 data
run: ./update-data.sh
continue-on-error: ${{ github.event_name != 'schedule' }}
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Cache pip
uses: actions/cache@v2
with:
path: |
~/.cache/pip
.venv
key: pip-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install and Build
run: |
pip install poetry
poetry config virtualenvs.in-project true
poetry install
- name: Generate charts
run: poetry run python chart.py
- name: Generate csv
run: poetry run python heatmap.py
- name: Move outputs
run: mv output public/output
- name: Deploy to Github Pages
uses: JamesIves/github-pages-deploy-action@v4.4.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: http
folder: public
clean: true