Skip to content

Commit

Permalink
ci: env ordering (#2)
Browse files Browse the repository at this point in the history
* ci: env ordering

* chore: env with dasheS

* Update vercel.yml

* Update vercel.yml
  • Loading branch information
rafaelcr committed Feb 23, 2023
1 parent 64c0cc1 commit bb70987
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/vercel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ jobs:
vercel:
runs-on: ubuntu-latest

environment:
name: ${{ github.ref_name == 'master' && 'Production' || 'Preview' }}
url: ${{ github.ref_name == 'master' && 'https://ordinals-api.vercel.app/' || 'https://ordinals-api-pbcblockstack-blockstack.vercel.app/' }}

env:
VERCEL_ENV: ${{ github.ref_name == 'master' && 'production' || 'preview' }}
VERCEL_PROD: ${{ github.ref_name == 'master' && '--prod' || '' }}

environment:
name: ${{ github.ref_name == 'master' && 'Production' || 'Preview' }}
url: ${{ github.ref_name == 'master' && 'https://ordinals-api.vercel.app/' || 'https://ordinals-api-pbcblockstack-blockstack.vercel.app/' }}

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

- name: Pull Vercel environment information
run: vercel pull --yes --environment=${{ VERCEL_ENV }} --token=${{ secrets.VERCEL_TOKEN }}
run: vercel pull --yes --environment=${{ env.VERCEL_ENV }} --token=${{ secrets.VERCEL_TOKEN }}

- name: Build project artifacts
run: vercel build ${{ VERCEL_PROD }} --token=${{ secrets.VERCEL_TOKEN }}
run: vercel build ${{ env.VERCEL_PROD }} --token=${{ secrets.VERCEL_TOKEN }}

- name: Deploy project artifacts to Vercel
id: deploy
run: vercel deploy ${{ VERCEL_PROD }} --prebuilt --token=${{ secrets.VERCEL_TOKEN }} | awk '{print "deployment_url="$1}' >> $GITHUB_OUTPUT
run: vercel deploy ${{ env.VERCEL_PROD }} --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' }}
uses: thollander/actions-comment-pull-request@v2
with:
comment_tag: vercel
message: |
Vercel deployment URL: ${{ steps.deploy.outputs.deployment_url }} :rocket:
Vercel deployment URL: ${{ steps.deploy.outputs.deployment_url }} :rocket:

0 comments on commit bb70987

Please sign in to comment.