website-deploy.yml 2.0 KB

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