Skip to content

Commit

Permalink
fix: vercel preview builds (#1783)
Browse files Browse the repository at this point in the history
* test: env echo

* fix: attempt direct comparison

* fix: var is a string

* fix: remove debug
  • Loading branch information
rafaelcr authored Dec 26, 2023
1 parent e4c080c commit d36b1c2
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/vercel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ jobs:
name: ${{ github.ref_name == 'master' && 'Production' || 'Preview' }}
url: ${{ github.ref_name == 'master' && 'https://stacks-blockchain-api.vercel.app/' || 'https://stacks-blockchain-api-pbcblockstack-blockstack.vercel.app/' }}

env:
PROD: ${{ github.ref_name == 'master' }}

steps:
- uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -53,14 +50,14 @@ jobs:
run: npm install --global vercel@latest

- name: Pull Vercel environment information
run: vercel pull --yes --environment=${{ env.PROD && 'production' || 'preview' }} --token=${{ secrets.VERCEL_TOKEN }}
run: vercel pull --yes --environment=${{ github.ref_name == 'master' && 'production' || 'preview' }} --token=${{ secrets.VERCEL_TOKEN }}

- name: Build project artifacts
run: vercel build ${{ env.PROD && '--prod' || '' }} --token=${{ secrets.VERCEL_TOKEN }}
run: vercel build ${{ github.ref_name == 'master' && '--prod' || '' }} --token=${{ secrets.VERCEL_TOKEN }}

- name: Deploy project artifacts to Vercel
id: deploy
run: vercel ${{ env.PROD && '--prod' || 'deploy' }} --prebuilt --token=${{ secrets.VERCEL_TOKEN }} | awk '{print "deployment_url="$1}' >> $GITHUB_OUTPUT
run: vercel ${{ github.ref_name == 'master' && '--prod' || 'deploy' }} --prebuilt --token=${{ secrets.VERCEL_TOKEN }} | awk '{print "deployment_url="$1}' >> $GITHUB_OUTPUT

- name: Add comment with Vercel deployment URL
if: ${{ github.event_name == 'pull_request' }}
Expand Down

0 comments on commit d36b1c2

Please sign in to comment.