@@ -0,0 +1,67 @@
1+name: "Update searx.data"
2+on:
3+ schedule:
4+ - cron: "37 13 * * 0"
5+
6+jobs:
7+ updateData:
8+ name: Update data
9+ runs-on: ubuntu-20.04
10+ if: env.DATA_PR_TOKEN != null
11+ steps:
12+ - name: Checkout
13+ uses: actions/checkout@v2
14+
15+ - name: Install Ubuntu packages
16+ run: |
17+ sudo ./utils/searx.sh install packages
18+
19+ - name: Set up Python
20+ uses: actions/setup-python@v2
21+ with:
22+ python-version: '3.9'
23+ architecture: 'x64'
24+
25+ - name: Cache Python dependencies
26+ id: cache-python
27+ uses: actions/cache@v2
28+ with:
29+ path: ./local
30+ key: python-${{ matrix.os }}-3.9-${{ hashFiles('requirements*.txt', 'setup.py') }}
31+
32+ - name: Install Python dependencies
33+ if: steps.cache-python.outputs.cache-hit != 'true'
34+ run: |
35+ make V=1 install
36+
37+ - name: Fetch data
38+ run: |
39+ source local/py3/bin/activate
40+ python utils/fetch_firefox_version.py
41+ python utils/fetch_languages.py
42+ python utils/fetch_ahmia_blacklist.py
43+ python utils/fetch_wikidata_units.py
44+ # python utils/fetch_currencies.py
45+
46+ - name: Create Pull Request
47+ id: cpr
48+ uses: peter-evans/create-pull-request@v3
49+ with:
50+ token: ${{ secrets.DATA_PR_TOKEN }}
51+ commit-message: Update searx.data
52+ committer: searx-bot <noreply@github.com>
53+ author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
54+ signoff: false
55+ branch: automatic-update-data
56+ delete-branch: true
57+ title: 'Update searx.data'
58+ body: |
59+ Update searx.data
60+ labels: |
61+ data
62+ draft: false
63+
64+ - name: Check outputs
65+ run: |
66+ echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
67+ echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"