Skip to content

Commit d36b1c2

Browse files
authored
fix: vercel preview builds (#1783)
* test: env echo * fix: attempt direct comparison * fix: var is a string * fix: remove debug
1 parent e4c080c commit d36b1c2

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

.github/workflows/vercel.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ jobs:
1919
name: ${{ github.ref_name == 'master' && 'Production' || 'Preview' }}
2020
url: ${{ github.ref_name == 'master' && 'https://stacks-blockchain-api.vercel.app/' || 'https://stacks-blockchain-api-pbcblockstack-blockstack.vercel.app/' }}
2121

22-
env:
23-
PROD: ${{ github.ref_name == 'master' }}
24-
2522
steps:
2623
- uses: actions/checkout@v2
2724
with:
@@ -53,14 +50,14 @@ jobs:
5350
run: npm install --global vercel@latest
5451

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

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

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

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

0 commit comments

Comments
 (0)