-
Notifications
You must be signed in to change notification settings - Fork 1
36 lines (34 loc) · 1.06 KB
/
update-oics.yaml
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
# Thanks to Simon Willison for the inspiration: https://simonwillison.net/2020/Oct/9/git-scraping/
name: Scrape latest orders and attachments
on:
workflow_dispatch:
schedule:
- cron: '12 8 * * *' # https://crontab.guru/#12_8_*_*_* (8 AM UTC = 3 AM ET, generally)
jobs:
update-oics:
runs-on: ubuntu-latest
steps:
- name: Check out this repo
uses: actions/checkout@v2
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: 16
- name: Pull Node packages
run: |-
cd scripts
npm install
- name: Fetch latest data
run: |-
node scripts/scrape-order-tables.js
node scripts/scrape-attachments.js
- name: Commit and push if it changed
run: |-
git config user.name "Automated"
git config user.email "actions@users.noreply.github.com"
git add attachment-ids.json
git add attachments/*.json
git add order-tables/*.json
timestamp=$(date -u)
git commit -m "Latest data: ${timestamp}" || exit 0
git push