data-update.yml: on PR per file

This commit is contained in:
Alexandre Flament 2021-02-25 08:41:17 +01:00 committed by GitHub
parent bc590cbc47
commit 728e096764
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 21 additions and 14 deletions

View File

@ -1,13 +1,22 @@
name: "Update searx.data" name: "Update searx.data"
on: on:
schedule: schedule:
- cron: "05 16 * * 5" - cron: "05 08 * * 5"
jobs: jobs:
updateData: updateData:
name: Update data name: Update data - ${{ matrix.fetch }}
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
if: ${{ github.repository_owner == 'searx'}} if: ${{ github.repository_owner == 'searx'}}
strategy:
matrix:
fetch:
- ahmia_blacklist
- currencies
- external_bangs
- firefox_version
- languages
- wikidata_units
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
@ -27,7 +36,7 @@ jobs:
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
path: ./local path: ./local
key: python-${{ matrix.os }}-3.9-${{ hashFiles('requirements*.txt', 'setup.py') }} key: python-ubuntu-20.04-3.9-${{ hashFiles('requirements*.txt', 'setup.py') }}
- name: Install Python dependencies - name: Install Python dependencies
if: steps.cache-python.outputs.cache-hit != 'true' if: steps.cache-python.outputs.cache-hit != 'true'
@ -35,31 +44,29 @@ jobs:
make V=1 install make V=1 install
- name: Fetch data - name: Fetch data
env:
FETCH_SCRIPT: utils/fetch_${{ matrix.fetch }}.py
run: | run: |
source local/py3/bin/activate source local/py3/bin/activate
python utils/fetch_firefox_version.py python $FETCH_SCRIPT
python utils/fetch_languages.py
python utils/fetch_ahmia_blacklist.py
python utils/fetch_wikidata_units.py
python utils/fetch_currencies.py
- name: Create Pull Request - name: Create Pull Request
id: cpr id: cpr
uses: peter-evans/create-pull-request@v3 uses: peter-evans/create-pull-request@v3
with: with:
token: ${{ secrets.DATA_PR_TOKEN }} token: ${{ secrets.DATA_PR_TOKEN }}
commit-message: Update searx.data commit-message: Update searx.data - ${{ matrix.fetch }}
committer: searx-bot <noreply@github.com> committer: searx-bot <noreply@github.com>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
signoff: false signoff: false
branch: automatic-update-data branch: update_data_${{ matrix.fetch }}
delete-branch: true delete-branch: true
title: 'Update searx.data' draft: false
title: 'Update searx.data - ${{ matrix.fetch }}'
body: | body: |
Update searx.data Update searx.data - ${{ matrix.fetch }}
labels: | labels: |
data data
draft: false
- name: Check outputs - name: Check outputs
run: | run: |