Skip to content

Commit

Permalink
Add a pre-deploy comment
Browse files Browse the repository at this point in the history
  • Loading branch information
katspaugh committed Nov 30, 2022
1 parent ac62922 commit aca5e78
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,17 @@ jobs:
BUCKET: s3://${{ secrets.AWS_DEVELOPMENT_BUCKET_NAME }}
run: bash ./scripts/github/s3_upload.sh

# Post a comment in the PR
- name: 'Post a comment while building'
if: github.ref != 'refs/heads/dev' && github.ref != 'refs/heads/main'
uses: mshick/add-pr-comment@v1
with:
message: |
## ![logo](https://user-images.githubusercontent.com/381895/186411381-e05075ff-7565-4b4e-925e-bb1e85cb165b.png) Branch preview
⏳ Deploying a preview site...
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token-user-login: 'github-actions[bot]'

# PRs
- name: Deploy PR branch
if: github.ref != 'refs/heads/dev' && github.ref != 'refs/heads/main'
Expand All @@ -70,18 +81,19 @@ jobs:
run: bash ./scripts/github/s3_upload.sh

- name: Generate QR Code
if: success() && github.ref != 'refs/heads/dev' && github.ref != 'refs/heads/main'
id: qrcode
uses: hammadj/qr-code-generator@master
with:
# Example using text outputted from another step action
content: "https://pr${{ github.event.number }}--webcore.review-web-core.5afe.dev"

- name: 'Post the deployment links in the PR'
if: success() && github.ref != 'refs/heads/dev' && github.ref != 'refs/heads/main'
uses: mshick/add-pr-comment@v1
with:
message: |
## Branch preview
## ![logo](https://user-images.githubusercontent.com/381895/186411381-e05075ff-7565-4b4e-925e-bb1e85cb165b.png) Branch preview
✅ Deploy successful!
https://pr${{ github.event.number }}--webcore.review-web-core.5afe.dev
![QR code](${{ steps.qrcode.output.data }})
repo-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit aca5e78

Please sign in to comment.