Skip to content

Commit 5eb23f6

Browse files
kolega-ai-devclaude
andcommitted
Add GitHub Actions deploy workflow and Google Analytics tag
- CI/CD pipeline syncs reports/ to S3 + CloudFront invalidation on push to main - Google Analytics (G-KJJ3ZH24H8) added to dashboard and scanner detail pages Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c7b15fd commit 5eb23f6

3 files changed

Lines changed: 58 additions & 0 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Deploy Dashboard to S3 + CloudFront
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'reports/**'
8+
9+
workflow_dispatch: # allow manual trigger
10+
11+
permissions:
12+
id-token: write
13+
contents: read
14+
15+
jobs:
16+
deploy:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Configure AWS credentials (OIDC)
22+
uses: aws-actions/configure-aws-credentials@v4
23+
with:
24+
role-to-assume: ${{ vars.AWS_DEPLOY_ROLE_ARN }}
25+
aws-region: us-east-1
26+
27+
- name: Sync reports to S3
28+
run: aws s3 sync reports/ s3://${{ vars.S3_BUCKET_NAME }}/ --delete
29+
30+
- name: Invalidate CloudFront cache
31+
run: |
32+
aws cloudfront create-invalidation \
33+
--distribution-id ${{ vars.AWS_CLOUDFRONT_DISTRIBUTION_ID }} \
34+
--paths "/*"

dashboard.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,14 @@ def build_html(
697697
w('<meta charset="UTF-8">')
698698
w('<meta name="viewport" content="width=device-width, initial-scale=1.0">')
699699
w("<title>RealVuln Benchmark</title>")
700+
w('<!-- Google tag (gtag.js) -->')
701+
w('<script async src="https://www.googletagmanager.com/gtag/js?id=G-KJJ3ZH24H8"></script>')
702+
w("<script>")
703+
w(" window.dataLayer = window.dataLayer || [];")
704+
w(" function gtag(){dataLayer.push(arguments);}")
705+
w(" gtag('js', new Date());")
706+
w(" gtag('config', 'G-KJJ3ZH24H8');")
707+
w("</script>")
700708
w(f"<style>{_common_css()}</style>")
701709
w("</head>")
702710
w("<body>")
@@ -1007,6 +1015,14 @@ def build_scanner_detail_html(
10071015
w('<meta charset="UTF-8">')
10081016
w('<meta name="viewport" content="width=device-width, initial-scale=1.0">')
10091017
w(f"<title>{display_name(scanner)} — RealVuln Scanner Detail</title>")
1018+
w('<!-- Google tag (gtag.js) -->')
1019+
w('<script async src="https://www.googletagmanager.com/gtag/js?id=G-KJJ3ZH24H8"></script>')
1020+
w("<script>")
1021+
w(" window.dataLayer = window.dataLayer || [];")
1022+
w(" function gtag(){dataLayer.push(arguments);}")
1023+
w(" gtag('js', new Date());")
1024+
w(" gtag('config', 'G-KJJ3ZH24H8');")
1025+
w("</script>")
10101026
w(f"<style>{_common_css()}</style>")
10111027
w("</head>")
10121028
w("<body>")

reports/dashboard.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<title>RealVuln Benchmark</title>
7+
<!-- Google tag (gtag.js) -->
8+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-KJJ3ZH24H8"></script>
9+
<script>
10+
window.dataLayer = window.dataLayer || [];
11+
function gtag(){dataLayer.push(arguments);}
12+
gtag('js', new Date());
13+
gtag('config', 'G-KJJ3ZH24H8');
14+
</script>
715
<style>
816
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600;700&family=Source+Code+Pro:wght@400;500;600&display=swap');
917

0 commit comments

Comments
 (0)