Update vercel deployment to branch deployment #37
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy examples to Vercel | |
env: | |
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} | |
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | |
on: | |
push: | |
branches: | |
- main | |
- feature-73-vercel-branch-deployments | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 21 | |
cache: 'npm' | |
cache-dependency-path: '**/package-lock.json' | |
- name: Install dependencies | |
run: | | |
npm ci | |
npm install lerna | |
npm install vercel | |
- name: Build SDKs | |
run: | | |
npm run build:dev | |
- name: Deploy react-sdk-example to Vercel | |
run: | | |
cd playground/react-sdk-example | |
npm install | |
npm run build | |
url="$(npx vercel deploy -t ${{ secrets.VERCEL_TOKEN }})" | |
npx vercel alias -S corbado -t ${{ secrets.VERCEL_TOKEN }} "$url" $BRANCH_NAME.react-sdk.passkeys.de | |
env: | |
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_REACT_SDK }} | |
- name: Deploy react-example to Vercel | |
run: | | |
cd playground/react-example | |
npm install | |
npm run build | |
url="$(npx vercel deploy -t ${{ secrets.VERCEL_TOKEN }})" | |
npx vercel alias -S corbado -t ${{ secrets.VERCEL_TOKEN }} "$url" $BRANCH_NAME.react.passkeys.de | |
env: | |
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_REACT }} |