fix secret for indexer workflow

This commit is contained in:
Dan Allen 2022-12-23 04:48:33 -07:00 committed by Marcus Hert Da Coregio
parent 409bd29abd
commit 5855bbb378
1 changed files with 4 additions and 6 deletions

View File

@ -6,6 +6,8 @@ jobs:
build:
if: github.repository_owner == 'spring-projects'
runs-on: ubuntu-latest
env:
CONFIG_FILE: .github/actions/docsearch-config.json
steps:
- name: Checkout
uses: actions/checkout@v3
@ -13,16 +15,12 @@ jobs:
fetch-depth: 5
- name: Configure Indexer
run: |
CONFIG_FILE=.github/actions/docsearch-config.json
if [ ! -f $CONFIG_FILE ]; then
curl -sL -o $CONFIG_FILE $(node -p "require('fs').readFileSync('antora-playbook.yml', 'utf8').match(/^ url: (.*)/m)[1]")/docsearch-config.json
fi
curl -sL -o $CONFIG_FILE $(node -p "require('fs').readFileSync('antora-playbook.yml', 'utf8').match(/^ url: (.*)/m)[1]")/docsearch-config.json
INDEX_NAME=$(node -p "JSON.parse(require('fs').readFileSync('$CONFIG_FILE')).index_name")
echo "CONFIG_FILE=${CONFIG_FILE}" >> $GITHUB_ENV
echo "INDEX_NAME_TMP=${INDEX_NAME}-${GITHUB_RUN_ID}" >> $GITHUB_ENV
- name: Run Indexer
uses: darrenjennings/algolia-docsearch-action@master
with:
algolia_application_id: ${{ secrets.ALGOLIA_APP_ID }}
algolia_application_id: ${{ secrets.ALGOLIA_APPLICATION_ID }}
algolia_api_key: ${{ secrets.ALGOLIA_API_KEY }}
file: ${{ env.CONFIG_FILE }}