Skip to content

Commit 4f1a92b

Browse files
committed
update workflow
1 parent 4a24a18 commit 4f1a92b

File tree

3 files changed

+28
-13
lines changed

3 files changed

+28
-13
lines changed

.github/workflows/deploy-script.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,19 @@ jobs:
1919
run: pnpm --filter @dub/analytics-script build
2020

2121
- name: Deploy to Cloudflare Pages
22+
id: cloudflare-deploy
2223
uses: cloudflare/wrangler-action@v3
2324
with:
2425
apiToken: ${{ secrets.CLOUDFLARE_PAGES_API_KEY }}
2526
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
2627
command: pages deploy dist --project-name=dub-cdn --commit-dirty=true
2728
workingDirectory: packages/script
2829
packageManager: pnpm
30+
31+
- name: Save Deployment URL to file
32+
run: echo "${{ steps.cloudflare-deploy.outputs.deployment-url }}" > deployment_url.txt
33+
34+
- uses: actions/upload-artifact@v4
35+
with:
36+
name: deployment-url
37+
path: deployment_url.txt

.github/workflows/playwright.yml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,21 @@ jobs:
3737
working-directory: apps/nextjs
3838
run: pnpm exec playwright install chromium --with-deps
3939

40-
# - name: Run Playwright tests
41-
# working-directory: apps/nextjs
42-
# run: pnpm exec playwright test
43-
# env:
44-
# DUB_ANALYTICS_SCRIPT_URL: ${{ github.event.workflow_run.outputs.deployment_url }}/analytics/script.site-visit.outbound-domains.js
45-
46-
# - uses: actions/upload-artifact@v4
47-
# if: ${{ !cancelled() }}
48-
# with:
49-
# name: playwright-report
50-
# path: apps/nextjs/playwright-report/
51-
# retention-days: 30
40+
- name: Download deployment URL
41+
uses: actions/download-artifact@v4
42+
with:
43+
name: deployment-url
44+
path: .
45+
46+
- name: Run Playwright tests
47+
working-directory: apps/nextjs
48+
run: pnpm exec playwright test
49+
env:
50+
DUB_ANALYTICS_SCRIPT_URL: $(cat deployment_url.txt)/analytics/script.site-visit.outbound-domains.js
51+
52+
- uses: actions/upload-artifact@v4
53+
if: ${{ !cancelled() }}
54+
with:
55+
name: playwright-report
56+
path: apps/nextjs/playwright-report/
57+
retention-days: 30

packages/script/src/base.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
(function () {
2-
console.log('Test the GH action 2');
2+
console.log('Test the GH action 3');
33

44
// Store script reference for extensions
55
const script = document.currentScript;

0 commit comments

Comments
 (0)