From 6a50007f815520bd75b90aa98d801da202deda7f Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Mon, 12 Sep 2022 18:23:39 +0200 Subject: [PATCH] don't announce preview environment till it can be pinged (#30682) --- .github/workflows/azure-preview-env-deploy.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/azure-preview-env-deploy.yml b/.github/workflows/azure-preview-env-deploy.yml index b103ec6afe..0c5af4e430 100644 --- a/.github/workflows/azure-preview-env-deploy.yml +++ b/.github/workflows/azure-preview-env-deploy.yml @@ -217,3 +217,17 @@ jobs: dockerRegistryUrl="${{ secrets.NONPROD_REGISTRY_SERVER }}" dockerRegistryUsername="${{ env.NONPROD_REGISTRY_USERNAME }}" dockerRegistryPassword="${{ secrets.NONPROD_REGISTRY_PASSWORD }}" + + - name: Check that it can reached + # To match the "Run ARM deploy" step above + if: ${{ !github.event.pull_request.auto_merge }} + # This introduces a necessary delay. Because the preview evironment + # URL is announced to the pull request as soon as all the steps + # finish, what sometimes happens is that a viewer of the PR clicks + # that link too fast and are confronted with a broken page. + # It's because there's a delay between the `azure/arm-deploy` + # and when the server is actually started and can receive and + # process requests. + # By introducing a slight "delay" here we avoid announcing a + # preview environment URL that isn't actually working just yet. + run: curl --retry-connrefused --retry 5 -I ${{ env.APP_URL }}