Skip to content

Daily Data Process #1566

Daily Data Process

Daily Data Process #1566

Workflow file for this run

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 }}