From d36b1c2d37b050eb826e1c80e5ef4674ca0ea699 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20C=C3=A1rdenas?= Date: Tue, 26 Dec 2023 12:26:59 -0600 Subject: [PATCH] fix: vercel preview builds (#1783) * test: env echo * fix: attempt direct comparison * fix: var is a string * fix: remove debug --- .github/workflows/vercel.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/vercel.yml b/.github/workflows/vercel.yml index b22e55ab..eec3a9cd 100644 --- a/.github/workflows/vercel.yml +++ b/.github/workflows/vercel.yml @@ -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: @@ -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' }}