Change workflow_run actions to address the new world of moda (#53631)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
2
.github/workflows/index-general-search.yml
vendored
2
.github/workflows/index-general-search.yml
vendored
@@ -19,7 +19,7 @@ on:
|
||||
schedule:
|
||||
- cron: '20 16 * * *' # Run every 24 hours at 20 minutes past the hour
|
||||
workflow_run:
|
||||
workflows: ['Azure Production - Build and Deploy']
|
||||
workflows: ['Purge Fastly']
|
||||
types:
|
||||
- completed
|
||||
|
||||
|
||||
@@ -7,8 +7,7 @@ name: Notify about production deployment
|
||||
on:
|
||||
workflow_dispatch:
|
||||
workflow_run:
|
||||
# Note, we could do this after the "Purge Fastly" finished
|
||||
workflows: ['Azure Production - Build and Deploy']
|
||||
workflows: ['Purge Fastly']
|
||||
types:
|
||||
- completed
|
||||
|
||||
|
||||
24
.github/workflows/purge-fastly.yml
vendored
24
.github/workflows/purge-fastly.yml
vendored
@@ -16,10 +16,9 @@ on:
|
||||
description: "Comma separated languages. E.g. 'en,ja, es' (defaults to all)"
|
||||
required: false
|
||||
default: ''
|
||||
workflow_run:
|
||||
workflows: ['Azure Production - Build and Deploy']
|
||||
types:
|
||||
- completed
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -43,6 +42,23 @@ jobs:
|
||||
|
||||
- uses: ./.github/actions/node-npm-setup
|
||||
|
||||
- name: Wait for production to match build number
|
||||
run: |
|
||||
needs=$(git rev-parse HEAD)
|
||||
start_time=$(date +%s)
|
||||
timeout_seconds=1200
|
||||
while [[ $needs != $(curl -s --fail --retry-connrefused --retry 5 https://docs.github.com/_build) ]]
|
||||
do
|
||||
if [[ $(($(date +%s) - $start_time)) -gt $timeout_seconds ]]
|
||||
then
|
||||
echo "Production did not match the build number within $timeout_seconds seconds"
|
||||
exit 1
|
||||
fi
|
||||
echo "Production is not up to date with the build commit"
|
||||
sleep 10
|
||||
done
|
||||
echo "Production is up to date with the build commit"
|
||||
|
||||
- name: Purge Fastly edge cache independent of language
|
||||
if: ${{ inputs.nuke_all }}
|
||||
run: npm run purge-fastly-edge-cache
|
||||
|
||||
Reference in New Issue
Block a user