-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (59 loc) · 1.99 KB
/
data-process.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
name: Daily Data Process
on:
schedule:
- cron: "0 9 * * *" # 台北下午5點下班時間
push:
branches: [ master ]
jobs:
# prune:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@master
# with:
# persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
# fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
# - name: Prune the "data/latest" directory from Git history
# timeout-minutes: 15
# run: |
# git config --local user.email "[email protected]"
# git config --local user.name "GitHub Action"
# git filter-branch --tree-filter "rm -rf data/latest" --prune-empty HEAD
# git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d
# git gc
# - name: Push changes
# uses: ad-m/github-push-action@master
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# force: true
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
- name: Install Dependencies
uses: actions/setup-node@v1
env:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 'true'
with:
args: install
- run: npm ci
- name: Create local changes
timeout-minutes: 15
uses: mujo-code/puppeteer-headful@master
env:
CI: 'true'
with:
args: npm run process
- name: Commit files
timeout-minutes: 15
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "更新健保署資料" -a
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}