data-update.yml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. name: "Update searx.data"
  2. on:
  3. schedule:
  4. - cron: "05 08 * * 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. - ahmia_blacklist
  14. - currencies
  15. - external_bangs
  16. - firefox_version
  17. - languages
  18. - wikidata_units
  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: Cache Python dependencies
  31. id: cache-python
  32. uses: actions/cache@v2
  33. with:
  34. path: ./local
  35. key: python-ubuntu-20.04-3.9-${{ hashFiles('requirements*.txt', 'setup.py') }}
  36. - name: Install Python dependencies
  37. if: steps.cache-python.outputs.cache-hit != 'true'
  38. run: |
  39. make V=1 install
  40. - name: Fetch data
  41. env:
  42. FETCH_SCRIPT: utils/fetch_${{ matrix.fetch }}.py
  43. run: |
  44. source local/py3/bin/activate
  45. python $FETCH_SCRIPT
  46. - name: Create Pull Request
  47. id: cpr
  48. uses: peter-evans/create-pull-request@v3
  49. with:
  50. token: ${{ secrets.DATA_PR_TOKEN }}
  51. commit-message: Update searx.data - ${{ matrix.fetch }}
  52. committer: searx-bot <noreply@github.com>
  53. author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
  54. signoff: false
  55. branch: update_data_${{ matrix.fetch }}
  56. delete-branch: true
  57. draft: false
  58. title: 'Update searx.data - ${{ matrix.fetch }}'
  59. body: |
  60. Update searx.data - ${{ matrix.fetch }}
  61. labels: |
  62. data
  63. - name: Check outputs
  64. run: |
  65. echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
  66. echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"