Index TED Developer Docs #633
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: Index TED Developer Docs | ||
on: | ||
workflow_dispatch | ||
#workflow_dispatch: | ||
#schedule: | ||
# * is a special character in YAML so you have to quote this string | ||
# - cron: '0 4 * * *' | ||
env: | ||
JOBS_REPO: github.com/OP-TED/OP-TED.github.io | ||
BUILD_JOB: Build and publish TED Developer Docs | ||
INDEX_JOB: Index TED Developer Docs | ||
jobs: | ||
delete_site_index: | ||
name: "Delete existing site index" | ||
runs-on: [ubuntu-latest] | ||
steps: | ||
- name: Download Algolia CLI | ||
run: 'mkdir -p algolia-cli; curl -L "https://github.com/algolia/cli/releases/download/v1.6.11/algolia_1.6.11_linux_386.tar.gz"|tar xpz -C algolia-cli --strip-components=1' | ||
- name: Create Algolia profile | ||
run: ./algolia-cli/algolia profile add --name ted-profile --app-id ${{ secrets.ALGOLIA_APPLICATION_ID }} --api-key ${{ secrets.ALGOLIA_API_KEY }} --default | ||
- name: Delete index ${{ secrets.ALGOLIA_INDEX_NAME }} | ||
run: | | ||
./algolia-cli/algolia indices list; \ | ||
if echo $(./algolia-cli/algolia indices list)|grep -q '${{ secrets.ALGOLIA_INDEX_NAME }}'; then \ | ||
./algolia-cli/algolia indices delete -y ${{ secrets.ALGOLIA_INDEX_NAME }}; \ | ||
fi; | ||
index_site: | ||
name: "Index site using Docsearch Crawler" | ||
needs: delete_site_index | ||
runs-on: [ubuntu-latest] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Get the content of docsearch-config.json as config | ||
id: docsearch_config | ||
run: echo "docsearch_config=$(cat config/docsearch-config.json | jq -r tostring)" >> ${GITHUB_ENV} | ||
- name: Run DocSearch Scraper | ||
run: | | ||
Check failure on line 46 in .github/workflows/index_site.yml GitHub Actions / Index TED Developer DocsInvalid workflow file
|
||
docker run -e "APPLICATION_ID=${{ secrets.ALGOLIA_APPLICATION_ID }}" -e "API_KEY=${{ secrets.ALGOLIA_API_KEY }}" -e "CONFIG=${{ cat config/docsearch-config.json | jq -r tostring }}" algolia/docsearch-scraper |