-
Notifications
You must be signed in to change notification settings - Fork 16
50 lines (42 loc) · 1.44 KB
/
scheduled.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
name: WinDiff Periodic Update
# Only one at a time
concurrency: windiff-periodic-update
on:
workflow_dispatch:
schedule:
# At 8:00am
- cron: "0 8 * * *"
# At 7:15pm on Tuesday
- cron: "15 19 * * TUE"
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
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: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Cache Python dependencies
uses: actions/cache@v3
with:
path: ${{ env.pythonLocation }}
key: v2-${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('.github/workflows/scheduled.yml') }}
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r ci/requirements.fetch_update.txt
- name: Run periodic update
run: |
python ci/fetch_update.py ci/db_configuration.json --kb-date-limit "1 year ago" --replace-configuration
- name: Commit & Push changes
uses: actions-js/push@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
author_name: windiff[bot]
message: Update configuration file
branch: master