Skip to content

Commit

Permalink
ci: use token instead of login
Browse files Browse the repository at this point in the history
  • Loading branch information
ali-hosseini-deriv committed Jun 24, 2024
1 parent c3c9ff7 commit 5a500ad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
16 changes: 6 additions & 10 deletions .github/actions/deploy-to-vercel/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,24 @@ runs:
run: npm install -g vercel
shell: bash

- name: Authenticate with Vercel
env:
VERCEL_TOKEN: ${{ inputs.VERCEL_TOKEN }}
run: vercel login --token ${{ env.VERCEL_TOKEN }}
shell: bash

- name: Deploy to Vercel (Staging)
if: ${{ inputs.ENVIRONMENT == 'staging' }}
if: ${{ inputs.ENVIRONMENT == 'Staging' }}
shell: bash
env:
VERCEL_ORG_ID: ${{ inputs.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ inputs.VERCEL_PROJECT_ID }}
VERCEL_TOKEN: ${{ inputs.VERCEL_TOKEN }}
run: |
url="$vercel deploy --cwd build"
url="$(vercel deploy --cwd build --token=$VERCEL_TOKEN)"
vercel alias set "$url" staging-api.binary.sx
- name: Deploy to Vercel (Production)
if: ${{ inputs.ENVIRONMENT == 'production' }}
if: ${{ inputs.ENVIRONMENT == 'Production' }}
shell: bash
env:
VERCEL_ORG_ID: ${{ inputs.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ inputs.VERCEL_PROJECT_ID }}
VERCEL_TOKEN: ${{ inputs.VERCEL_TOKEN }}
run: |
url="$vercel deploy --cwd build"
url="$(vercel deploy --cwd build --token=$VERCEL_TOKEN)"
vercel alias set "$url" api.binary.sx
2 changes: 1 addition & 1 deletion .github/workflows/vercel-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ jobs:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_API_TOKEN }}
ENVIRONMENT: staging
ENVIRONMENT: Staging

0 comments on commit 5a500ad

Please sign in to comment.