deploy-staging-netlify.yml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. name: Deploy to Staging Netlify
  2. on:
  3. push:
  4. # TODO: Migrate to staging branch only
  5. branches: [main]
  6. jobs:
  7. build:
  8. name: Push build files to Netlify
  9. runs-on: ubuntu-latest
  10. steps:
  11. - name: Checkout Repository
  12. uses: actions/checkout@v3
  13. - name: Setup and run pnpm install
  14. uses: pnpm/action-setup@v2.2.4
  15. env:
  16. VITE_BACKEND_GQL_URL: ${{ secrets.STAGING_BACKEND_GQL_URL }}
  17. with:
  18. version: 7
  19. run_install: true
  20. - name: Build Site
  21. env:
  22. VITE_GA_ID: ${{ secrets.STAGING_GA_ID }}
  23. VITE_GTM_ID: ${{ secrets.STAGING_GTM_ID }}
  24. VITE_API_KEY: ${{ secrets.STAGING_FB_API_KEY }}
  25. VITE_AUTH_DOMAIN: ${{ secrets.STAGING_FB_AUTH_DOMAIN }}
  26. VITE_DATABASE_URL: ${{ secrets.STAGING_FB_DATABASE_URL }}
  27. VITE_PROJECT_ID: ${{ secrets.STAGING_FB_PROJECT_ID }}
  28. VITE_STORAGE_BUCKET: ${{ secrets.STAGING_FB_STORAGE_BUCKET }}
  29. VITE_MESSAGING_SENDER_ID: ${{ secrets.STAGING_FB_MESSAGING_SENDER_ID }}
  30. VITE_APP_ID: ${{ secrets.STAGING_FB_APP_ID }}
  31. VITE_BASE_URL: ${{ secrets.STAGING_BASE_URL }}
  32. VITE_BACKEND_GQL_URL: ${{ secrets.STAGING_BACKEND_GQL_URL }}
  33. VITE_BACKEND_WS_URL: ${{ secrets.STAGING_BACKEND_WS_URL }}
  34. VITE_SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
  35. VITE_SENTRY_RELEASE_TAG: ${{ github.sha }}
  36. VITE_SENTRY_ENVIRONMENT: staging
  37. run: pnpm run generate
  38. # Deploy the staging site with netlify-cli
  39. - name: Deploy to Netlify (staging)
  40. run: npx netlify-cli deploy --dir=packages/hoppscotch-web/dist --prod
  41. env:
  42. NETLIFY_SITE_ID: ${{ secrets.NETLIFY_STAGING_SITE_ID }}
  43. NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
  44. - name: Create Sentry Release
  45. uses: getsentry/action-release@v1
  46. env:
  47. SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
  48. SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
  49. SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
  50. with:
  51. environment: staging
  52. ignore_missing: true
  53. ignore_empty: true
  54. version: ${{ github.sha }}