Skip to content

fix: add token

fix: add token #26

Workflow file for this run

# name: CI
# on:
# push:
# branches: ["main"]
# pull_request:
# types: [opened, synchronize]
# jobs:
# build:
# name: Build and Test
# timeout-minutes: 15
# runs-on: ubuntu-latest
# # To use Remote Caching, uncomment the next lines and follow the steps below.
# # env:
# # TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
# # TURBO_TEAM: ${{ vars.TURBO_TEAM }}
# steps:
# - name: Check out code
# uses: actions/checkout@v4
# with:
# fetch-depth: 2
# - uses: pnpm/action-setup@v3
# with:
# version: 8
# - name: Setup Node.js environment
# uses: actions/setup-node@v4
# with:
# node-version: 20
# cache: 'pnpm'
# - name: Install dependencies
# run: pnpm install
# - name: Build
# run: pnpm build
# - name: Test
# run: pnpm test
name: Production Tag Deployment
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
on:
push:
# Pattern matched against refs/tags
tags:
- '*' # Push events to every tag not containing /
jobs:
Deploy-Production:
environment: Production
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install pnpm
run: npm install -g pnpm@6
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Set branch/tag name environment variable
id: get_branch_or_tag
run: echo "BRANCH_OR_TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Test inject env
run: vercel --build-env KEY1=value1 --build-env KEY2=$BRANCH_OR_TAG --token=${{ secrets.VERCEL_TOKEN }}
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --target preview --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --target preview --token=${{ secrets.VERCEL_TOKEN }}