Run indexer #5969
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: Run indexer | |
on: | |
schedule: | |
- cron: "15 */2 * * *" | |
workflow_dispatch: | |
env: | |
OUTPUT_PATH: ${{ github.workspace }}/output | |
APP_PATH: ${{ github.workspace }}/src/ScoopSearch.Indexer.Console/ | |
GitHub__Token: ${{ secrets.GITHUB_TOKEN }} | |
DOTNET_VERSION: '8.0.x' | |
jobs: | |
main: | |
name: Build and run indexer ⚙️️🚀🌐 | |
runs-on: ubuntu-latest | |
environment: ${{ github.ref == 'refs/heads/main' && 'Production' || 'Staging' }} | |
concurrency: ci-${{ github.ref }}-${{ vars.AZURESEARCH__SERVICEURL }}-${{ vars.AZURESEARCH__INDEXNAME }} | |
env: | |
AZURESEARCH__SERVICEURL: ${{ vars.AZURESEARCH__SERVICEURL }} | |
AZURESEARCH__INDEXNAME: ${{ vars.AZURESEARCH__INDEXNAME }} | |
AZURESEARCH__ADMINAPIKEY: ${{ secrets.AZURESEARCH__ADMINAPIKEY }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup .NET ${{ env.DOTNET_VERSION }} | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ env.DOTNET_VERSION }} | |
- name: Install dependencies | |
run: dotnet restore ${{ env.APP_PATH }} | |
- name: Publish | |
run: > | |
dotnet publish ${{ env.APP_PATH }} | |
--configuration Release | |
--no-restore | |
--output ${{ env.OUTPUT_PATH }} | |
- name: Run indexer | |
run: | | |
cd ${{ env.OUTPUT_PATH }} | |
./ScoopSearch.Indexer.Console | |
- name: Upload logs | |
uses: actions/upload-artifact@v4 | |
if: success() || failure() | |
with: | |
name: logs | |
path: ${{ env.OUTPUT_PATH }}/output.txt | |
keepalive: | |
name: Keepalive Workflow | |
runs-on: ubuntu-latest | |
permissions: | |
actions: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: gautamkrishnar/keepalive-workflow@v2 |