data-update.yml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. name: "Update searx.data"
  2. on:
  3. schedule:
  4. - cron: "05 06 * * 5"
  5. workflow_dispatch:
  6. jobs:
  7. updateData:
  8. name: Update data - ${{ matrix.fetch }}
  9. runs-on: ubuntu-20.04
  10. if: ${{ github.repository_owner == 'searx'}}
  11. strategy:
  12. matrix:
  13. fetch:
  14. - update_ahmia_blacklist.py
  15. - update_currencies.py
  16. - update_external_bangs.py
  17. - update_firefox_version.py
  18. - update_languages.py
  19. - update_wikidata_units.py
  20. steps:
  21. - name: Checkout
  22. uses: actions/checkout@v2
  23. - name: Install Ubuntu packages
  24. run: |
  25. sudo ./utils/searx.sh install packages
  26. - name: Set up Python
  27. uses: actions/setup-python@v2
  28. with:
  29. python-version: '3.9'
  30. architecture: 'x64'
  31. - name: Install Python dependencies
  32. run: |
  33. pip install -U pip wheel setuptools
  34. pip install -r requirements.txt
  35. - name: Fetch data
  36. env:
  37. FETCH_SCRIPT: ./searx_extra/update/${{ matrix.fetch }}
  38. run: |
  39. source local/py3/bin/activate
  40. $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 }}"