Download updates and regenerate plots #1832
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
# this file controls the GitHub action that automatically downloads the latest | |
# data tables every night and regenerates the plots | |
name: Download updates and regenerate plots | |
on: | |
# Trigger the workflow on push, | |
# but only for the master branch | |
push: | |
branches: | |
- master | |
schedule: | |
# run this job every day at 1:00 am UTC | |
- cron: '0 1 * * *' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: "!contains(github.event.head_commit.message, 'skip')" | |
strategy: | |
# it should only run once, and python 3.10 is as good as any | |
matrix: | |
python-version: ['3.10'] | |
steps: | |
# check out the repository to make changes | |
- name: Checkout the repo | |
uses: actions/checkout@v3 | |
# get a local python going | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
# get all the up-to-date packages needed | |
- name: Install dependencies | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
environment-file: environment.yml | |
auto-update-conda: true | |
python-version: ${{ matrix.python-version }} | |
# update the planet parameters tables | |
- name: Download files | |
shell: bash -l {0} | |
run: | | |
python download-planet-data.py | |
# regenerate all the figures | |
- name: Update plots | |
shell: bash -l {0} | |
run: | | |
./update.sh | |
# push the changes back to the GitHub repository | |
# from https://github.com/marketplace/actions/git-auto-commit | |
- name: Commit back the changes | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Rerun with updated planet lists | |
branch: master |