Skip to content

Commit

Permalink
custom domain for previews
Browse files Browse the repository at this point in the history
  • Loading branch information
haffi96 committed Oct 27, 2023
1 parent 9011833 commit 3b3df58
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .github/workflows/deploy-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
pull_request:
branches: ["master"]

permissions:
pull-requests: write

jobs:
aws_cdk_test_deploy:
name: CDK Test Deployment
Expand Down Expand Up @@ -47,6 +50,8 @@ jobs:
vercel_test_deploy:
name: Vercel preview Deployment
runs-on: ubuntu-latest
env:
PREVIEW_DOMAIN: eng-feed-dev.vercel.app
needs: [aws_cdk_test_deploy]
steps:
- uses: actions/checkout@v4
Expand All @@ -57,4 +62,12 @@ jobs:
- name: Build Project Artifacts
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
run: |
url="$(vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }})"
vercel alias --token=${{ secrets.VERCEL_TOKEN }} set "$url" $PREVIEW_DOMAIN
- name: Comment custom domain on PR
uses: thollander/actions-comment-pull-request@v2
with:
message: |
Preview: https://${{ env.PREVIEW_DOMAIN }}
comment_tag: preview_comment_tag

0 comments on commit 3b3df58

Please sign in to comment.