Skip to content

Commit 808744b

Browse files
committed
set CONFIG and WORKSPACE variable for indexer job globally [skip ci]
1 parent 53a11f8 commit 808744b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

.github/workflows/indexer.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,22 @@ jobs:
1919
needs: activate
2020
runs-on: ubuntu-latest
2121
container: algolia/docsearch-scraper:v1.12.0
22+
env:
23+
CONFIG: ${{ github.workspace }}/docsearch/config.json
24+
REMOTE_CONFIG: https://docs.asciidoctor.org/docsearch-config.json
25+
WORKSPACE: ${{ github.workspace }}
2226
steps:
2327
- name: Checkout
2428
run: |
2529
wget https://github.com/${{ github.repository }}/archive/refs/heads/main.tar.gz
26-
mkdir -p ${{ github.workspace }}
27-
tar -C ${{ github.workspace }} --strip-components=1 -zxf $PWD/main.tar.gz
28-
echo ${{ github.workspace }}
29-
ls ${{ github.workspace }}
30+
mkdir -p $WORKSPACE
31+
tar -C $WORKSPACE --strip-components=1 -zxf $PWD/main.tar.gz
3032
- name: Index
3133
env:
3234
APPLICATION_ID: ${{ secrets.ALGOLIA_APP_ID }}
3335
API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
34-
CONFIG: ${{ github.workspace }}/docsearch/config.json
3536
run: |
36-
curl -L -o $CONFIG https://docs.asciidoctor.org/docsearch-config.json
37+
curl -L -o $CONFIG $REMOTE_CONFIG
3738
INDEX_NAME=$(node -p "JSON.parse(require('fs').readFileSync('$CONFIG')).index_name")
3839
SITEMAP_URL=$(node -p "JSON.parse(require('fs').readFileSync('$CONFIG')).sitemap_urls[0].replace('.xml', '-ROOT.xml')")
3940
# only run indexer if index is more than 2 days out of date

0 commit comments

Comments
 (0)