fix(board): resolve comments #3358
This file contains hidden or 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: Vercel Nova Preview Deployment | |
env: | |
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_NOVA_PROJECT_ID }} | |
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
TURBO_TEAM: ${{ secrets.TURBO_TEAM }} | |
GOOGLE_VERTEX_PROJECT: ${{ secrets.GOOGLE_VERTEX_PROJECT }} | |
GOOGLE_VERTEX_LOCATION: ${{ secrets.GOOGLE_VERTEX_LOCATION }} | |
on: | |
push: | |
branches-ignore: | |
- production | |
workflow_dispatch: | |
jobs: | |
Deploy-Preview: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- name: Check for newer commits | |
id: check_commits | |
run: | | |
CURRENT_BRANCH=${GITHUB_REF#refs/heads/} | |
git fetch origin $CURRENT_BRANCH || { echo "Remote branch not found, continuing with build"; echo "skip_build=false" >> $GITHUB_OUTPUT; exit 0; } | |
LATEST_COMMIT=$(git rev-parse origin/$CURRENT_BRANCH 2>/dev/null || echo "") | |
CURRENT_COMMIT=${GITHUB_SHA} | |
if [ -n "$LATEST_COMMIT" ] && [ "$LATEST_COMMIT" != "$CURRENT_COMMIT" ]; then | |
echo "Newer commit found on $CURRENT_BRANCH branch. Skipping build." | |
echo "skip_build=true" >> $GITHUB_OUTPUT | |
else | |
echo "This is the latest commit or new branch. Proceeding with build." | |
echo "skip_build=false" >> $GITHUB_OUTPUT | |
fi | |
- name: Cache turbo build setup | |
if: steps.check_commits.outputs.skip_build != 'true' | |
uses: actions/cache@v4 | |
with: | |
path: .turbo | |
key: ${{ runner.os }}-turbo-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-turbo- | |
- name: Setup bun | |
if: steps.check_commits.outputs.skip_build != 'true' | |
uses: oven-sh/setup-bun@v2 | |
- name: Use Node.js 24 | |
if: steps.check_commits.outputs.skip_build != 'true' | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 24 | |
- name: Install dependencies | |
if: steps.check_commits.outputs.skip_build != 'true' | |
run: bun install | |
- name: Install Vercel CLI | |
if: steps.check_commits.outputs.skip_build != 'true' | |
run: bun install --global vercel@latest | |
- name: Pull Vercel Environment Information | |
if: steps.check_commits.outputs.skip_build != 'true' | |
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} | |
- name: Build Project Artifacts | |
if: steps.check_commits.outputs.skip_build != 'true' | |
run: vercel build --token=${{ secrets.VERCEL_TOKEN }} | |
- name: Deploy Project Artifacts to Vercel | |
if: steps.check_commits.outputs.skip_build != 'true' | |
run: vercel deploy --archive=tgz --prebuilt --token=${{ secrets.VERCEL_TOKEN }} |