8383 github_token : ${{ secrets.GITHUB_TOKEN }}
8484 publish_dir : ./public
8585
86- pre_index :
86+ index :
8787 # this job effectively tests the indexing before the next job that
8888 # clears it (so that the site doesn't end up empty if the indexing fails)
8989 runs-on : ubuntu-latest
@@ -113,27 +113,12 @@ jobs:
113113 public/tutorials \
114114 https://learn.astropy.org/tutorials
115115
116- clear_index :
117- # this job clears all records in the Algolia index to ensure new content appears on
118- # the site
119- runs-on : ubuntu-latest
120- needs : pre_index
121-
122- steps :
123- - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
124-
125- - name : Set up Python
126- uses : actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
127- with :
128- python-version : 3.12
129-
130- - name : Install Python dependencies
131- run : |
132- python -m pip install -U pip
133- python -m pip install -r deployment/requirements.txt
116+ - name : sleep
117+ run : sleep 5
134118
135119 - name : Clear Algolia index
136120 id : clearindex
121+ if : steps.preindex.outcome == 'success'
137122 env :
138123 ALGOLIA_ID : ${{ secrets.ALGOLIA_ID }}
139124 ALGOLIA_KEY : ${{ secrets.ALGOLIA_KEY }}
@@ -144,24 +129,11 @@ jobs:
144129 --algolia-key "$ALGOLIA_KEY" \
145130 --index "$ALGOLIA_INDEX"
146131
147- index :
148- runs-on : ubuntu-latest
149- needs : clear_index
150-
151- steps :
152- - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
153-
154- - name : Set up Python
155- uses : actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
156- with :
157- python-version : 3.12
158-
159- - name : Install Python dependencies
160- run : |
161- python -m pip install -U pip
162- python -m pip install -r deployment/requirements.txt
132+ - name : sleep
133+ run : sleep 5
163134
164135 - name : Index tutorials
136+ if : steps.clearindex.outcome == 'success'
165137 env :
166138 ALGOLIA_ID : ${{ secrets.ALGOLIA_ID }}
167139 ALGOLIA_KEY : ${{ secrets.ALGOLIA_KEY }}
0 commit comments