data-update.yml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. name: "Update searx.data"
  2. on:
  3. schedule:
  4. - cron: "05 06 1 * *"
  5. workflow_dispatch:
  6. permissions:
  7. contents: read
  8. jobs:
  9. updateData:
  10. name: Update data - ${{ matrix.fetch }}
  11. runs-on: ubuntu-20.04
  12. if: ${{ github.repository_owner == 'searx'}}
  13. strategy:
  14. matrix:
  15. fetch:
  16. - update_ahmia_blacklist.py
  17. - update_currencies.py
  18. - update_external_bangs.py
  19. - update_firefox_version.py
  20. - update_languages.py
  21. - update_wikidata_units.py
  22. steps:
  23. - name: Checkout
  24. uses: actions/checkout@v2
  25. - name: Install Ubuntu packages
  26. run: |
  27. sudo ./utils/searx.sh install packages
  28. - name: Set up Python
  29. uses: actions/setup-python@v2
  30. with:
  31. python-version: '3.10'
  32. architecture: 'x64'
  33. - name: Install Python dependencies
  34. run: |
  35. make V=1 install
  36. - name: Fetch data
  37. env:
  38. FETCH_SCRIPT: ./searx_extra/update/${{ matrix.fetch }}
  39. run: |
  40. V=1 ./manage pyenv.cmd python "$FETCH_SCRIPT"
  41. - name: Create Pull Request
  42. id: cpr
  43. uses: peter-evans/create-pull-request@v3
  44. with:
  45. token: ${{ secrets.DATA_PR_TOKEN }}
  46. commit-message: Update searx.data - ${{ matrix.fetch }}
  47. committer: searx-bot <noreply@github.com>
  48. author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
  49. signoff: false
  50. branch: update_data_${{ matrix.fetch }}
  51. delete-branch: true
  52. draft: false
  53. title: 'Update searx.data - ${{ matrix.fetch }}'
  54. body: |
  55. Update searx.data - ${{ matrix.fetch }}
  56. labels: |
  57. data
  58. - name: Check outputs
  59. run: |
  60. echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
  61. echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"