website-deploy.yml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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: Install Vercel CLI
  36. run: npm install --global vercel@canary
  37. - name: Pull Vercel Environment Information
  38. run: npx vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
  39. - name: Build Project Artifacts
  40. run: npx vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
  41. - name: Deploy Project Artifacts to Vercel
  42. run: npx vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}