Merge pull request #62 from dubinc/track-lead-sale #217
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
| name: Deploy Analytics Script to Cloudflare Pages | |
| on: | |
| push: | |
| paths: | |
| - 'packages/script/**' | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Install | |
| uses: ./.github/composite-actions/install | |
| - name: Install Dependencies and Build | |
| run: pnpm --filter @dub/analytics-script build | |
| - name: Deploy to Cloudflare Pages | |
| id: cloudflare-deploy | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_PAGES_API_KEY }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| command: pages deploy dist --project-name=dub-cdn --commit-dirty=true | |
| workingDirectory: packages/script | |
| packageManager: pnpm | |
| # Dispatch deployment event to trigger Playwright tests | |
| - name: Dispatch deployment event | |
| uses: peter-evans/repository-dispatch@v3 | |
| with: | |
| event-type: analytics-script-deployed | |
| client-payload: '{"deployment_url": "${{ steps.cloudflare-deploy.outputs.deployment-url }}"}' |