DocSearch Scrap #361
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: DocSearch Scrap | |
on: | |
# Allow to run manually | |
workflow_dispatch: | |
# Trigger on successful deployment status | |
deployment_status: | |
jobs: | |
update-docsearch: | |
name: Update DocSearch | |
runs-on: ubuntu-latest | |
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'deployment_status' && github.event.deployment_status.state == 'success' && github.ref == 'refs/heads/master') | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Docker | |
uses: FuelLabs/github-actions/setups/docker@master | |
with: | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Update DocSearch | |
run: | | |
docker run \ | |
--env ALGOLIA_APP_ID=${ALGOLIA_APP_ID} \ | |
--env ALGOLIA_API_KEY=${ALGOLIA_API_KEY} \ | |
--env "CONFIG=$(cat docsearch.json | jq -r tostring)" \ | |
algolia/docsearch-scraper | |
env: | |
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }} | |
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }} |