deploy_dashboard.yml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. name: '🚀 Deploy Dashboard'
  2. on:
  3. push:
  4. branches:
  5. - minor
  6. - major
  7. - master
  8. env:
  9. NEXT_TELEMETRY_DISABLED: 1
  10. NODE_OPTIONS: '--max_old_space_size=4096'
  11. jobs:
  12. deploy:
  13. runs-on: ubuntu-latest
  14. env:
  15. VERCEL_ENV: ${{ github.ref_name == 'minor' && 'development' || github.ref_name == 'major' && 'major' || 'production' }}
  16. steps:
  17. - name: Checkout repository
  18. uses: actions/checkout@v4
  19. - name: Install Node.js
  20. uses: actions/setup-node@v4
  21. with:
  22. node-version: 22
  23. cache: 'npm'
  24. - name: Install dependencies
  25. run: npm install
  26. - name: Install Vercel CLI
  27. run: npm i -g vercel@latest
  28. - name: Build common and core packages
  29. run: npm run build:core-common
  30. - name: Link folder to project
  31. run: vercel link --yes --scope vendure --project=admin-dashboard --token=${{ secrets.VERCEL_TOKEN }}
  32. - name: Pull Vercel Environment Information
  33. run: vercel pull --cwd ./packages/dashboard --environment=${{ env.VERCEL_ENV }} --yes --scope vendure --token=${{ secrets.VERCEL_TOKEN }}
  34. - name: Build Project Artifacts
  35. run: vercel build --scope vendure --token=${{ secrets.VERCEL_TOKEN }} ${{ env.VERCEL_ENV == 'production' && '--prod' || '' }}
  36. - name: Deploy Project Artifacts to Vercel
  37. id: deploy_vercel
  38. run: vercel deploy --archive=tgz --prebuilt --scope vendure ${{ env.VERCEL_ENV == 'production' && '--prod' || '' }} --token=${{ secrets.VERCEL_TOKEN }} | awk 'END{print}' | awk '{print "URL="$1}' >> $GITHUB_OUTPUT
  39. - name: Print Vercel URL
  40. shell: bash
  41. run: |
  42. echo "Vercel URL: ${{ steps.deploy_vercel.outputs.URL }}"
  43. echo "Vercel Environment: ${{ env.VERCEL_ENV }}"