Skip to content

Commit

Permalink
config: separate share-preview-url action (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
tamssokari authored May 12, 2023
1 parent d438053 commit c33f30f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,3 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
DEST_DIR: ${{ steps.set_dest_dir.outputs.DEST_DIR }}
# Publish the inspect and preview link to the PR
- name: share preview url as PR comment
if: github.event.pull_request.opened == true || github.event.pull_request.ready_for_review == true
uses: unsplash/comment-on-pr@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
msg: "This branch has been deployed to s3 / cloudfront.\n\n✅ Preview URL: https://cdn.smileidentity.com/${{ steps.set_dest_dir.outputs.DEST_DIR }}/smart-camera-web.js"
22 changes: 22 additions & 0 deletions .github/workflows/share-preview-url.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: share-preview-url
on:
pull_request:
types:
- opened
- ready_for_review

jobs:
comment-on-pr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: get dest dir
id: get_dest_dir
run: echo "DEST_DIR=js/preview-$GITHUB_HEAD_REF" >> "$GITHUB_OUTPUT"
- name: share preview url as PR comment
uses: unsplash/comment-on-pr@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
msg: "This branch has been deployed to s3 / cloudfront.\n\n✅ Preview URL: https://cdn.smileidentity.com/${{ steps.get_dest_dir.outputs.DEST_DIR }}/smart-camera-web.js"

0 comments on commit c33f30f

Please sign in to comment.