From 5e38d7001286cf6d8eeee5769a42915c938aed2a Mon Sep 17 00:00:00 2001 From: WooWan Date: Fri, 26 Jul 2024 15:21:09 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20=EB=B0=B0=ED=8F=AC=20=ED=94=84?= =?UTF-8?q?=EB=A6=AC=EB=B7=B0=20comment=20=ED=85=8C=EC=8A=A4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy-preview.yaml | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-preview.yaml b/.github/workflows/deploy-preview.yaml index 2b230fe..fc36f28 100644 --- a/.github/workflows/deploy-preview.yaml +++ b/.github/workflows/deploy-preview.yaml @@ -3,9 +3,8 @@ env: VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} on: - push: - branches-ignore: - - main + pull_request: + types: [opened, synchronize, reopened] jobs: Deploy-Preview: runs-on: ubuntu-latest @@ -19,4 +18,22 @@ jobs: - name: Build Project Artifacts run: vercel build --token=${{ secrets.VERCEL_TOKEN }} - name: Deploy Project Artifacts to Vercel + id: deploy run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} + + - name: Find Comment + uses: peter-evans/find-comment@v2 + id: fc + with: + issue-number: ${{ github.event.pull_request.number }} + comment-author: "github-actions[bot]" + body-includes: Preview deployed to + - name: Create or Update Comment + uses: peter-evans/create-or-update-comment@v4 + with: + comment-id: ${{ steps.fc.outputs.comment-id }} + issue-number: ${{ github.event.pull_request.number }} + body: | + Preview deployed to: ${{ steps.deploy.outputs.url }} + Last updated: ${{ github.event.pull_request.updated_at }} + edit-mode: replace