data-update.yml 1.9 KB

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