Skip to content

Commit

Permalink
try out new action
Browse files Browse the repository at this point in the history
  • Loading branch information
andromaqui committed Jul 24, 2024
1 parent 1142433 commit db0b080
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 19 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/preview-env-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
message-id: mymessageid
refresh-message-position: true
message: |
:construction: The preview environment for the commit ${{ github.sha }} is being built. This usually takes 15-20 minutes. <!-- preview-env -->
Expand Down Expand Up @@ -70,6 +71,7 @@ jobs:
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
message-id: mymessageid
refresh-message-position: true
message: |
:arrow_up: The preview environment build results for commit ${{ github.sha }} are being uploaded. This usually takes 3-4 minutes. <!-- preview-env -->
Expand All @@ -95,5 +97,6 @@ jobs:
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
message-id: mymessageid
refresh-message-position: true
message: |
The preview environment relating to the commit ${{ github.sha }} has successfully been deployed. You can access it at [https://${{ env.BUCKET_NAME }}/pr-${{ github.event.number }}/index.html](https://${{ env.BUCKET_NAME }}/pr-${{ github.event.number }}/index.html) <!-- preview-env -->
31 changes: 12 additions & 19 deletions .github/workflows/preview-env-teardown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,14 @@ jobs:
with:
credentials_json: ${{ steps.secrets.outputs.PREVIEW_ENV_GCLOUD_SA_KEY }}

- name: Find deployment status comment
uses: peter-evans/find-comment@v3
id: find-comment
- name: Add or Update Comment - Build Status
uses: mshick/add-pr-comment@v2
with:
issue-number: ${{ github.event.number }}
body-includes: <!-- preview-env -->

- name: Update comment with tear-down warning
if: steps.find-comment.outputs.comment-id != ''
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
body: |
repo-token: ${{ secrets.GITHUB_TOKEN }}
message-id: mymessageid
refresh-message-position: true
message: |
:warning: Preview environment for commit ${{ github.sha }} is being deleted. This usually takes 2-3 minutes. <!-- preview-env -->
edit-mode: replace
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
Expand All @@ -63,11 +56,11 @@ jobs:
env: ${{ github.event.repository.name }}
ref: ${{ github.event.pull_request.head.sha }}

- name: Update comment with tear-down status
if: steps.find-comment.outputs.comment-id != ''
uses: peter-evans/create-or-update-comment@v4
- name: Add or Update Comment - Build Status
uses: mshick/add-pr-comment@v2
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
body: |
repo-token: ${{ secrets.GITHUB_TOKEN }}
message-id: mymessageid
refresh-message-position: true
message: |
:broom: Preview environment for this PR has been torn down. <!-- preview-env -->
edit-mode: replace

0 comments on commit db0b080

Please sign in to comment.