WinDiff Periodic Update #434
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |