summaryrefslogtreecommitdiff
path: root/.github/workflows/data-update.yml
blob: e3e04ee9570ce95ce5e04d5cbf244a88f9ff601d (plain)
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
---
name: Update searx.data

# yamllint disable-line rule:truthy
on:
  workflow_dispatch:
  schedule:
    - cron: "59 23 28 * *"

concurrency:
  group: ${{ github.workflow }}
  cancel-in-progress: false

permissions:
  contents: read

env:
  PYTHON_VERSION: "3.14"

jobs:
  data:
    if: github.repository_owner == 'searxng'
    name: ${{ matrix.fetch }}
    runs-on: ubuntu-26.04-arm
    strategy:
      fail-fast: false
      matrix:
        fetch:
          - update_ahmia_blacklist.py
          - update_currencies.py
          - update_external_bangs.py
          - update_firefox_version.py
          - update_engine_traits.py
          - update_wikidata.py
          - update_engine_descriptions.py

    permissions:
      contents: write
      pull-requests: write

    steps:
      - name: Setup Python
        uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97  # v7.0.0
        with:
          python-version: "${{ env.PYTHON_VERSION }}"

      - name: Checkout
        uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1  # v7.0.1
        with:
          persist-credentials: "false"

      - name: Setup cache Python
        uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9  # v6.1.0
        with:
          key: "python-${{ env.PYTHON_VERSION }}-${{ runner.arch }}-${{ hashFiles('./requirements*.txt') }}"
          restore-keys: |
            python-${{ env.PYTHON_VERSION }}-${{ runner.arch }}-
          path: "./local/"

      - name: Setup venv
        run: make V=1 install

      - name: Fetch data
        run: V=1 ./manage pyenv.cmd python "./searxng_extra/update/${{ matrix.fetch }}"

      - name: Create PR
        uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1  # v8.1.1
        with:
          author: "searxng-bot <searxng-bot@users.noreply.github.com>"
          committer: "searxng-bot <searxng-bot@users.noreply.github.com>"
          title: "[mod] data: update searx.data - ${{ matrix.fetch }}"
          commit-message: "[mod] data: update searx.data - ${{ matrix.fetch }}"
          branch: "ci-data-${{ matrix.fetch }}"
          delete-branch: "true"
          draft: "false"
          signoff: "false"
          body: |
            Update searx.data - ${{ matrix.fetch }}
          labels: |
            data