From d78cd9c3f1b32fac0f9d7bbc2260f751f6b8ab89 Mon Sep 17 00:00:00 2001 From: Andromachi Rozaki Date: Wed, 19 Jun 2024 00:02:44 +0200 Subject: [PATCH] deploy changes again --- .github/workflows/preview-env-deploy.yml | 36 +++++++++++++----------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/.github/workflows/preview-env-deploy.yml b/.github/workflows/preview-env-deploy.yml index 262d5f4a037..9ae76f30d2c 100644 --- a/.github/workflows/preview-env-deploy.yml +++ b/.github/workflows/preview-env-deploy.yml @@ -24,6 +24,24 @@ jobs: secret/data/products/camunda-docs/ci/preview-environment PREVIEW_ENV_BUCKET_NAME; secret/data/products/camunda-docs/ci/preview-environment PREVIEW_ENV_GCLOUD_SA_KEY; + - name: Find env tear down comment + uses: peter-evans/find-comment@v1 + id: find-teardown-comment + with: + issue-number: ${{ github.event.number }} + body-includes: Your preview env has been torn down. + + - name: Update env tear down comment + if: steps.find-teardown-comment.outputs.comment-id != '' + uses: peter-evans/create-or-update-comment@v4 + env: + BUCKET_NAME: ${{ steps.secrets.outputs.PREVIEW_ENV_BUCKET_NAME }} + with: + comment-id: ${{ steps.find-teardown-comment.outputs.comment-id }} + body: | + Preview environment has successfully been deployed. You can access it on https://${{ env.BUCKET_NAME }}/pr-${{ github.event.number }}/index.html. + edit-mode: replace + - name: Find deployment comment uses: peter-evans/find-comment@v1 id: find-deployment-comment @@ -63,7 +81,7 @@ jobs: # If the deployment comment is found, remove the old static files from the bucket # before uploading the new build - name: Remove files from Google bucket from previous deployment - if: steps.find-deployment-comment.outputs.comment-id != '' + if: steps.find-deployment-comment.outputs.comment-id != '' && steps.find-teardown-comment.outputs.comment-id == '' env: BUCKET_NAME: ${{ steps.secrets.outputs.PREVIEW_ENV_BUCKET_NAME }} run: | @@ -85,22 +103,6 @@ jobs: env: ${{ steps.deployment.outputs.env }} deployment_id: ${{ steps.deployment.outputs.deployment_id }} - - name: Find env tear down comment - uses: peter-evans/find-comment@v1 - id: find-teardown-comment - with: - issue-number: ${{ github.event.number }} - body-includes: Your preview env has been torn down. - - - name: Update env tear down comment - if: steps.find-teardown-comment.outputs.comment-id != '' - uses: peter-evans/create-or-update-comment@v4 - with: - comment-id: ${{ steps.find-teardown-comment.outputs.comment-id }} - body: | - Your preview env has been torn down. - edit-mode: replace - - name: Create comment if: steps.find-deployment-comment.outputs.comment-id == '' uses: peter-evans/create-or-update-comment@v4