2021-01-24 11:40:32 +01:00
|
|
|
name: "Update searx.data"
|
|
|
|
on:
|
|
|
|
schedule:
|
2021-02-25 08:41:17 +01:00
|
|
|
- cron: "05 08 * * 5"
|
2021-01-24 11:40:32 +01:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
updateData:
|
2021-02-25 08:41:17 +01:00
|
|
|
name: Update data - ${{ matrix.fetch }}
|
2021-01-24 11:40:32 +01:00
|
|
|
runs-on: ubuntu-20.04
|
2021-02-12 16:56:00 +01:00
|
|
|
if: ${{ github.repository_owner == 'searx'}}
|
2021-02-25 08:41:17 +01:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
fetch:
|
|
|
|
- ahmia_blacklist
|
|
|
|
- currencies
|
|
|
|
- external_bangs
|
|
|
|
- firefox_version
|
|
|
|
- languages
|
|
|
|
- wikidata_units
|
2021-01-24 11:40:32 +01:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Install Ubuntu packages
|
|
|
|
run: |
|
|
|
|
sudo ./utils/searx.sh install packages
|
|
|
|
|
|
|
|
- name: Set up Python
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: '3.9'
|
|
|
|
architecture: 'x64'
|
|
|
|
|
|
|
|
- name: Cache Python dependencies
|
|
|
|
id: cache-python
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ./local
|
2021-02-25 08:41:17 +01:00
|
|
|
key: python-ubuntu-20.04-3.9-${{ hashFiles('requirements*.txt', 'setup.py') }}
|
|
|
|
|
2021-01-24 11:40:32 +01:00
|
|
|
- name: Install Python dependencies
|
|
|
|
if: steps.cache-python.outputs.cache-hit != 'true'
|
|
|
|
run: |
|
|
|
|
make V=1 install
|
|
|
|
|
|
|
|
- name: Fetch data
|
2021-02-25 08:41:17 +01:00
|
|
|
env:
|
|
|
|
FETCH_SCRIPT: utils/fetch_${{ matrix.fetch }}.py
|
2021-01-24 11:40:32 +01:00
|
|
|
run: |
|
|
|
|
source local/py3/bin/activate
|
2021-02-25 08:41:17 +01:00
|
|
|
python $FETCH_SCRIPT
|
2021-01-24 11:40:32 +01:00
|
|
|
|
|
|
|
- name: Create Pull Request
|
|
|
|
id: cpr
|
|
|
|
uses: peter-evans/create-pull-request@v3
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.DATA_PR_TOKEN }}
|
2021-02-25 08:41:17 +01:00
|
|
|
commit-message: Update searx.data - ${{ matrix.fetch }}
|
2021-01-24 11:40:32 +01:00
|
|
|
committer: searx-bot <noreply@github.com>
|
|
|
|
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
|
|
|
|
signoff: false
|
2021-02-25 08:41:17 +01:00
|
|
|
branch: update_data_${{ matrix.fetch }}
|
2021-01-24 11:40:32 +01:00
|
|
|
delete-branch: true
|
2021-02-25 08:41:17 +01:00
|
|
|
draft: false
|
|
|
|
title: 'Update searx.data - ${{ matrix.fetch }}'
|
2021-01-24 11:40:32 +01:00
|
|
|
body: |
|
2021-02-25 08:41:17 +01:00
|
|
|
Update searx.data - ${{ matrix.fetch }}
|
2021-01-24 11:40:32 +01:00
|
|
|
labels: |
|
|
|
|
data
|
|
|
|
|
|
|
|
- name: Check outputs
|
|
|
|
run: |
|
|
|
|
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
|
|
|
|
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
|