deploy_dashboard.yml 2.1 KB

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