-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Save plots to file, & add image-creation workflow
- Loading branch information
Showing
4 changed files
with
60 additions
and
5 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Create Images and Upload to Imgur | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 12 * * *' | ||
jobs: | ||
upload-image: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: Generate | ||
run: | | ||
python sea-surface-temps.py --mode map --dataset sst --days-ago 1 --out sst-map.png | ||
python sea-surface-temps.py --mode map --dataset anom --days-ago 1 --out sst-anom-map.png | ||
python sea-surface-temps.py --mode all --dataset sst --out sst-all.png | ||
python sea-surface-temps.py --mode all --dataset anom --out sst-all-anom.png | ||
- name: Upload images to Imgur | ||
env: | ||
IMGUR_CLIENT_ID: ${{ secrets.IMGUR_CLIENT_ID }} | ||
run: | | ||
curl --request POST \ | ||
--url https://api.imgur.com/3/image \ | ||
--header "Authorization: Client-ID $IMGUR_CLIENT_ID" \ | ||
--form image=@"./sst-map.png" | ||
curl --request POST \ | ||
--url https://api.imgur.com/3/image \ | ||
--header "Authorization: Client-ID $IMGUR_CLIENT_ID" \ | ||
--form image=@"./sst-anom-map.png" | ||
curl --request POST \ | ||
--url https://api.imgur.com/3/image \ | ||
--header "Authorization: Client-ID $IMGUR_CLIENT_ID" \ | ||
--form image=@"./sst-all.png" | ||
curl --request POST \ | ||
--url https://api.imgur.com/3/image \ | ||
--header "Authorization: Client-ID $IMGUR_CLIENT_ID" \ | ||
--form image=@"./sst-all-anom.png" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sst-data-cache.json | ||
|
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
Large diffs are not rendered by default.
Oops, something went wrong.