-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (39 loc) · 1.56 KB
/
update_plots.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
name: Update Plots
on:
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment: ${{ vars.ENVIRONMENT_STAGE }}
steps:
- name: 🍽️ Get working copy
uses: actions/checkout@main
with:
fetch-depth: 1
- name: 🐍 Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: '3.10.10'
- name: 💿 Install required packages
run: pip install Pillow requests matplotlib numpy tqdm pandas cartopy scipy pytz
- name: 🍳 Update Plots
env:
DATASHEET_ID: ${{ secrets.DATASHEET_ID }}
ADDITIONAL_SPENDING_ID: ${{ secrets.ADDITIONAL_SPENDING_ID }}
MAPBOX_STYLE_ID: ${{ secrets.MAPBOX_STYLE_ID }}
MAPBOX_STYLE_TOKEN: ${{ secrets.MAPBOX_STYLE_TOKEN }}
run: |
cd ${GITHUB_WORKSPACE}/src/
python automation.py
- name: 🕵️ Check if there are any changes
id: verify_diff
run: |
git diff --quiet . || echo "changed=true" >> $GITHUB_OUTPUT
- name: 🚀 Commit & Push
if: steps.verify_diff.outputs.changed == 'true'
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git add .
git commit -am "feat(actions): Updated plots"
git push --all -f https://${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git