Deploy Retheme Preview #44
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 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 }} | |
timeout-minutes: ${{ fromJSON(vars.TIMEOUT_MINUTES_NORMAL) }} | |
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: | | |
CLERK_RETHEME=1 npx turbo build --force | |
- 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: /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 |