This repository has been archived by the owner on Mar 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (74 loc) · 2.45 KB
/
autoupdate.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
75
76
77
78
79
80
81
82
83
84
85
name: Auto-Update
on:
workflow_dispatch:
permissions:
contents: write
issues: write
jobs:
update:
name: Update Data
runs-on: ubuntu-latest
env:
TZ: America/Chicago
steps:
- name: Checkout
uses: actions/checkout@v2
with:
token: ${{ secrets.GH_PAT }}
- name: Auto-Update Data
run: |
python autoupdate.py
git add daily-data/ --intent-to-add
- name: Check for New Data
uses: tj-actions/[email protected]
id: changed_files
with:
files: |
daily-data
- name: Commit and Push (Update)
uses: EndBug/add-and-commit@v7
with:
add: 'content/ daily-data/'
default_author: github_actions
message: 'chore: add daily data'
branch: main
push: false
# Archive the HCHD dashboard to the Wayback Machine
- name: Archive HCHD Dashboard
uses: JamieMagee/[email protected]
id: archive
if: steps.changed_files.outputs.files_changed == 'true'
continue-on-error: true
with:
url: https://allthingsmissouri.org/county-covid-19-dashboards/howell-county/
saveErrors: false
saveOutlinks: true
saveScreenshot: false
# Notify of archive step failure if needed
- name: Create Issue for Archive Failure
uses: imjohnbo/[email protected]
if: steps.archive.outcome == 'failure'
with:
assignees: jonblatho
title: HCHD dashboard archive failed
labels: bug
body: |-
Encountered an error when attempting to archive the HCHD dashboard to the Wayback Machine.
pinned: true
token: ${{ secrets.GH_PAT }}
# If the archive was successful, add the archive URL to the data
- name: Add Archive URL to Data
if: steps.archive.outcome == 'success' && steps.archive.outputs.wayback_url != ''
id: add_archive_url
run: python add-source-url.py ${{ steps.archive.outputs.wayback_url }}
- name: Commit and Push (Archive)
uses: EndBug/add-and-commit@v7
if: steps.add_archive_url.outcome == 'success' && steps.archive.outputs.wayback_url != ''
with:
add: 'daily-data/'
default_author: github_actions
message: 'chore: add archive URL'
branch: main
push: true
- name: Push Retry
run: git push