diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 8e945798..ab1e1d69 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -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" diff --git a/.github/workflows/share-preview-url.yml b/.github/workflows/share-preview-url.yml new file mode 100644 index 00000000..805e8711 --- /dev/null +++ b/.github/workflows/share-preview-url.yml @@ -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" +