Skip to content

added project config usage (#176) #252

added project config usage (#176)

added project config usage (#176) #252

name: Deploy Playground Apps to Vercel
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
BRANCH_NAME_RAW: ${{ github.head_ref || github.ref_name }}
on:
pull_request:
push:
branches:
- main
- bugfix-conditional-ui-unconfirmed-credential
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
#- name: Cache node modules
# id: cache-nodemodules
# uses: actions/cache@v2
# env:
# cache-name: cache-node-modules
# with:
# path: node_modules
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-build-${{ env.cache-name }}-
# ${{ runner.os }}-build-
# ${{ runner.os }}-
- name: Install Dependencies
# if: steps.cache-nodemodules.outputs.cache-hit != 'true'
run: |
npm ci
npm install lerna
npm install vercel
- name: Check ESLint Errors
run: npm run lint
- name: Check Prettier Formatting
run: npm run prettier:check
- name: Build SDKs
run: |
npm run build
npm run build:bundler:local
- name: Normalize branch name
run: |
echo "BRANCH_NAME=$(echo $BRANCH_NAME_RAW | tr '/_' '-')" >> "$GITHUB_ENV"
shell: bash
- name: Deploy react-sdk playground to Vercel
run: |
cd playground/react-sdk
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.playground.corbado.io
env:
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_REACT_SDK_PLAYGROUND }}
- name: Deploy react playground to Vercel
run: |
cd playground/react
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.playground.corbado.io
env:
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_REACT_PLAYGROUND }}
- name: Deploy web-js playground to Vercel
run: |
cd playground/web-js
npx vercel pull -t $VERCEL_TOKEN
npx vercel build -t $VERCEL_TOKEN
url="$(npx vercel deploy --prebuilt -t ${{ secrets.VERCEL_TOKEN }})"
npx vercel alias -S corbado -t ${{ secrets.VERCEL_TOKEN }} "$url" $BRANCH_NAME.web-js.playground.corbado.io
env:
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_WEB_JS_PLAYGROUND }}
- name: Deploy web-js-script playground to Vercel
run: |
cd playground/web-js-script
npx vercel pull -t $VERCEL_TOKEN
npx vercel build -t $VERCEL_TOKEN
url="$(npx vercel deploy --prebuilt -t ${{ secrets.VERCEL_TOKEN }})"
npx vercel alias -S corbado -t ${{ secrets.VERCEL_TOKEN }} "$url" $BRANCH_NAME.web-js-script.playground.corbado.io
env:
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_WEB_JS_SCRIPT_PLAYGROUND }}