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' }}