Update-search-index #1104
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update-search-index | |
on: | |
schedule: | |
- cron: "1 0 * * *" | |
workflow_dispatch: | |
jobs: | |
update-search-index: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: false | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: "3.x" | |
- name: setup git config | |
run: | | |
git config user.name "GitHub Actions Bot" | |
git config user.email "<>" | |
- name: Get current date | |
id: date | |
run: echo "::set-output name=date::$(date +'%Y-%m-%d')" | |
- name: Install dependencies | |
run: pip install -r requirements.txt | |
- name: Get interesting repositories | |
run: python3 interesting.py | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build DB | |
run: python3 init-db.py | |
- name: Download repos | |
run: python3 download.py | |
- name: Update search index | |
run: python3 search.py | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.date.outputs.date }} | |
release_name: Release ${{ steps.date.outputs.date }} | |
draft: false | |
prerelease: true | |
- name: Upload Release Asset 1/2 | |
id: upload-release-asset-1 | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./repos.db | |
asset_name: repos.db | |
asset_content_type: application/vnd.sqlite3 | |
- name: Upload Release Asset 2/2 | |
id: upload-release-asset-2 | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./repos-extended.db | |
asset_name: repos-extended.db | |
asset_content_type: application/vnd.sqlite3 |