data-update.yml 1.9 KB

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