Skip to content

Deploy Retheme Preview #1841

Deploy Retheme Preview

Deploy Retheme Preview #1841

name: Deploy Retheme Preview
run-name: Deploy Retheme Preview
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_CLERK_PROD_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_JS_RETHEME_PROJECT_ID }}
on:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.actor }}
cancel-in-progress: true
jobs:
preview:
runs-on: ${{ vars.RUNNER_NORMAL || 'ubuntu-latest' }}
timeout-minutes: ${{ vars.TIMEOUT_MINUTES_NORMAL && fromJSON(vars.TIMEOUT_MINUTES_NORMAL) || 10 }}
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup
id: config
uses: ./.github/actions/init
with:
turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }}
turbo-team: ${{ vars.TURBO_TEAM }}
turbo-token: ${{ secrets.TURBO_TOKEN }}
registry-url: 'https://registry.npmjs.org'
- name: Build packages
run: npx turbo build $TURBO_ARGS
- name: Install site in isolation
run: node scripts/install-site-in-isolation.mjs playground/nextjs
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel environment information
run: |
cd $FULL_TMP_FOLDER
vercel pull --yes --environment=production --token=${{ secrets.VERCEL_CLERK_COOKIE_TOKEN }}
- name: Copy clerk-js/dist into public/clerk-js of test site
run: |
cp -r $GITHUB_WORKSPACE/packages/clerk-js/dist $FULL_TMP_FOLDER/public/clerk-js
- name: Build with Vercel
run: |
cd $FULL_TMP_FOLDER
vercel build --yes --prod
env:
NEXT_PUBLIC_CLERK_JS_URL: /clerk-js/clerk.browser.js
- name: Deploy to Vercel (prebuilt)
id: vercel-deploy
run: |
cd $FULL_TMP_FOLDER
vercel deploy --prebuilt --token=${{ secrets.VERCEL_CLERK_COOKIE_TOKEN }} --no-wait --prod > deployment_url.txt
echo "url=$(cat deployment_url.txt)" >> $GITHUB_OUTPUT