5050 pr_branch : ${{ env.PR_BRANCH }}
5151 steps :
5252 - name : " Auto: Grab PR"
53- if : ${{ github.event_name == 'pull_request' }}
53+ if : github.event_name == 'pull_request'
5454 env :
5555 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5656 run : |
@@ -116,13 +116,14 @@ jobs:
116116 - test-pr
117117 - check-renv
118118 runs-on : ubuntu-latest
119- if : ${{ needs.test-pr.outputs.is_valid == 'true' }}
119+ if : needs.test-pr.outputs.is_valid == 'true'
120120 env :
121121 CHIVE : ${{ github.workspace }}/site/chive
122122 PR : ${{ github.workspace }}/site/pr
123123 GHWMD : ${{ github.workspace }}/site/built
124124 PR_BRANCH : ${{ needs.test-pr.outputs.pr_branch }}
125125 PR_NUMBER : ${{ needs.test-pr.outputs.pr_number }}
126+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
126127 permissions :
127128 checks : write
128129 contents : write
@@ -133,17 +134,17 @@ jobs:
133134 env :
134135 WORKBENCH_PROFILE : " ci"
135136 GITHUB_PAT : ${{ secrets.GITHUB_TOKEN }}
137+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
136138 RENV_PATHS_ROOT : /home/rstudio/lesson/renv
137139 RENV_PROFILE : " lesson-requirements"
138140 RENV_CONFIG_EXTERNAL_LIBRARIES : " /usr/local/lib/R/site-library"
139141 volumes :
140142 - ${{ github.workspace }}:/home/rstudio/lesson
141143 options : --cpus 2
144+ outputs :
145+ workbench-update : ${{ steps.wb-vers.outputs.workbench-update }}
142146 steps :
143- - name : " Check Out PR Branch"
144- uses : actions/checkout@v4
145- # with:
146- # ref: ${{ env.PR_BRANCH }}
147+ - uses : actions/checkout@v4
147148
148149 - name : " Check Out Staging Branch"
149150 uses : actions/checkout@v4
@@ -168,23 +169,25 @@ jobs:
168169
169170 - name : Get Container Version Used
170171 id : wb-vers
171- if : ${{ needs.check-renv.outputs.renv-needed == 'true' }}
172+ if : needs.check-renv.outputs.renv-needed == 'true'
172173 uses : carpentries/actions/container-version@frog-s3-test-1
173174 with :
174175 WORKBENCH_TAG : ${{ vars.WORKBENCH_TAG }}
175176 renv-needed : ${{ needs.check-renv.outputs.renv-needed }}
176177
177178 - name : " Validate Current Org and Workflow"
178179 id : validate-org-workflow
179- if : ${{ needs.check-renv.outputs.renv-needed == 'true' }}
180+ if : needs.check-renv.outputs.renv-needed == 'true'
180181 uses : carpentries/actions/validate-org-workflow@frog-s3-test-1
181182 with :
182183 repo : ${{ github.repository }}
183184 workflow : ${{ github.workflow }}
184185
185186 - name : Configure AWS credentials via OIDC
186187 id : aws-creds
187- if : ${{ steps.validate-org-workflow.outputs.is_valid == 'true' && needs.check-renv.outputs.renv-needed == 'true' }}
188+ if : |
189+ steps.validate-org-workflow.outputs.is_valid == 'true' &&
190+ needs.check-renv.outputs.renv-needed == 'true'
188191 uses : aws-actions/configure-aws-credentials@v5.0.0
189192 with :
190193 role-to-assume : ${{ secrets.AWS_GH_OIDC_ARN }}
@@ -194,7 +197,7 @@ jobs:
194197 - name : Get cache object from S3
195198 id : s3-cache
196199 uses : carpentries/actions-cache@frog-matchedkey-1
197- if : ${{ needs.check-renv.outputs.renv-needed == 'true' }}
200+ if : needs.check-renv.outputs.renv-needed == 'true'
198201 with :
199202 # insecure: false # optional, use http instead of https. default false
200203 accessKey : ${{ steps.aws-creds.outputs.aws-access-key-id }}
@@ -209,7 +212,9 @@ jobs:
209212 ${{ github.repository }}/${{ steps.wb-vers.outputs.container-version }}_renv-
210213
211214 - name : " Fortify renv Cache"
212- if : ${{ needs.check-renv.outputs.renv-needed == 'true' && steps.s3-cache.outputs.cache-hit != 'true'}}
215+ if : |
216+ needs.check-renv.outputs.renv-needed == 'true' &&
217+ steps.s3-cache.outputs.cache-hit != 'true'
213218 run : |
214219 Rscript /home/rstudio/.workbench/fortify_renv_cache.R
215220
@@ -260,12 +265,12 @@ jobs:
260265 shell : Rscript {0}
261266
262267 pr-checks :
263- name : " Trigger PR Checks"
268+ name : " Trigger PR Checks? "
264269 needs :
265270 - test-pr
266271 - build-md-source
267272 runs-on : ubuntu-latest
268- if : ${{ needs.test-pr.outputs.is_valid == 'true' }}
273+ if : needs.test-pr.outputs.is_valid == 'true'
269274 permissions :
270275 actions : write
271276 checks : write
@@ -279,3 +284,24 @@ jobs:
279284 run : |
280285 gh workflow run pr-comment.yaml --ref main --field workflow_id=${{ github.run_id }}
281286 shell : bash
287+
288+ cache-update :
289+ name : " Trigger Update Cache Workflow?"
290+ needs :
291+ - check-renv
292+ - build-md-source
293+ runs-on : ubuntu-latest
294+ if : |
295+ needs.check-renv.outputs.renv-needed == 'true' &&
296+ needs.build-md-source.outputs.workbench-update == 'true' &&
297+ needs.build-md-source.build-site.outcome == 'success'
298+ permissions :
299+ actions : write
300+ checks : write
301+ steps :
302+ - name : " Trigger renv rebuild"
303+ env :
304+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
305+ run : |
306+ gh workflow run update-cache.yaml
307+ shell : bash
0 commit comments