Update Plots #94
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |