1
0
mirror of synced 2026-01-03 15:05:54 -05:00

Move delay for Heroku Preboot to before marking deployment successful (#21736)

* Move delay for Heroku Preboot from post-deploy to pre-success

* Shorten arbitrary delay before first Fastly purge
This commit is contained in:
James M. Greene
2021-09-24 19:35:13 -05:00
committed by GitHub
parent 433b3afd53
commit a76f30e5f2
3 changed files with 22 additions and 25 deletions

View File

@@ -129,9 +129,10 @@ jobs:
HYDRO_ENDPOINT: ${{ secrets.HYDRO_ENDPOINT }}
HYDRO_SECRET: ${{ secrets.HYDRO_SECRET }}
SOURCE_BLOB_URL: ${{ steps.build-source.outputs.download_url }}
DELAY_FOR_PREBOOT: 'true'
with:
script: |
const { GITHUB_TOKEN, HEROKU_API_TOKEN, SOURCE_BLOB_URL } = process.env
const { GITHUB_TOKEN, HEROKU_API_TOKEN, SOURCE_BLOB_URL, DELAY_FOR_PREBOOT } = process.env
// Exit if GitHub Actions PAT is not found
if (!GITHUB_TOKEN) {
@@ -158,6 +159,7 @@ jobs:
try {
await deployToProduction({
octokit,
includeDelayForPreboot: DELAY_FOR_PREBOOT !== 'false',
// These parameters will ONLY be set by Actions
sourceBlobUrl: SOURCE_BLOB_URL,
runId: context.runId
@@ -205,7 +207,6 @@ jobs:
FASTLY_TOKEN: ${{ secrets.FASTLY_TOKEN }}
FASTLY_SERVICE_ID: ${{ secrets.FASTLY_SERVICE_ID }}
FASTLY_SURROGATE_KEY: 'all-the-things'
DELAY_FOR_PREBOOT: 'true'
with:
script: |
// Workaround to allow us to load ESM files with `require(...)`
@@ -215,9 +216,7 @@ jobs:
const { default: purgeEdgeCache } = require('./script/deployment/purge-edge-cache')
try {
await purgeEdgeCache({
includeDelayForPreboot: process.env.DELAY_FOR_PREBOOT !== 'false'
})
await purgeEdgeCache()
} catch (error) {
console.error(`Failed to purge the edge cache: ${error.message}`)
console.error(error)