website-deploy.yml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. name: Deploy roocode.com
  2. on:
  3. push:
  4. branches:
  5. - main
  6. paths:
  7. - "apps/web-roo-code/**"
  8. workflow_dispatch:
  9. env:
  10. VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
  11. VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
  12. jobs:
  13. check-secrets:
  14. runs-on: ubuntu-latest
  15. outputs:
  16. has-vercel-token: ${{ steps.check.outputs.has-vercel-token }}
  17. steps:
  18. - name: Check if VERCEL_TOKEN exists
  19. id: check
  20. run: |
  21. if [ -n "${{ secrets.VERCEL_TOKEN }}" ]; then
  22. echo "has-vercel-token=true" >> $GITHUB_OUTPUT
  23. else
  24. echo "has-vercel-token=false" >> $GITHUB_OUTPUT
  25. fi
  26. deploy:
  27. runs-on: ubuntu-latest
  28. needs: check-secrets
  29. if: ${{ needs.check-secrets.outputs.has-vercel-token == 'true' }}
  30. steps:
  31. - name: Checkout code
  32. uses: actions/checkout@v4
  33. - name: Setup Node.js and pnpm
  34. uses: ./.github/actions/setup-node-pnpm
  35. - name: Migrate evals database
  36. run: pnpm db:migrate:production
  37. working-directory: packages/evals
  38. env:
  39. DATABASE_URL: ${{ secrets.EVALS_DATABASE_URL }}
  40. - name: Install Vercel CLI
  41. run: npm install --global vercel@canary
  42. - name: Pull Vercel Environment Information
  43. run: npx vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
  44. - name: Build Project Artifacts
  45. run: npx vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
  46. - name: Deploy Project Artifacts to Vercel
  47. run: npx vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}