feat: integrate Stripe subscription flow & add e2e verification tests #373
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This file was auto-generated by the Firebase CLI | |
| # https://github.com/firebase/firebase-tools | |
| name: Deploy to Firebase Hosting on PR | |
| "on": | |
| pull_request: | |
| branches-ignore: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| deploy-firebase-pr: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm ci-dev-build | |
| env: | |
| SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - uses: FirebaseExtended/action-hosting-deploy@v0 | |
| id: firebase_deploy | |
| with: | |
| repoToken: "${{ secrets.GITHUB_TOKEN }}" | |
| firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_WHATSANALYZE_80665 }}" | |
| projectId: whatsanalyze-80665 | |
| env: | |
| FIREBASE_CLI_PREVIEWS: hostingchannels | |
| - name: Create GitHub Deployment | |
| if: steps.firebase_deploy.outputs.details_url != '' | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const url = '${{ steps.firebase_deploy.outputs.details_url }}'; | |
| const deployment = await github.rest.repos.createDeployment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| ref: context.payload.pull_request ? context.payload.pull_request.head.sha : context.sha, | |
| environment: 'Preview', | |
| description: 'Firebase Hosting Preview Deployment', | |
| auto_merge: false, | |
| required_contexts: [], | |
| transient_environment: true | |
| }); | |
| if (deployment.data && deployment.data.id) { | |
| await github.rest.repos.createDeploymentStatus({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| deployment_id: deployment.data.id, | |
| state: 'success', | |
| environment: 'Preview', | |
| environment_url: url, | |
| description: 'Deployed to Firebase Hosting preview channel' | |
| }); | |
| } | |
| - name: Sentry Release | |
| uses: getsentry/action-release@v1.1.5 | |
| env: | |
| SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
| SENTRY_ORG: ${{ secrets.SENTRY_ORG }} | |
| SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} | |
| with: | |
| environment: pr | |
| sourcemaps: "./dist" |