Skip to content

Commit c1ba3e9

Browse files
committed
deploy secure signal
1 parent e048642 commit c1ba3e9

File tree

2 files changed

+159
-2
lines changed

2 files changed

+159
-2
lines changed

.github/workflows/secureSignal-cd.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ jobs:
7474
- name: Deploy UID2 Secure Signals to CDN
7575
uses: ./.github/actions/cdn_deployment_aws
7676
with:
77-
environment: ${{ matrix.environment }}
7877
artifact: ${{ (matrix.environment == 'integ' && 'development') || matrix.environment }}Uid2SecureSignalScript
7978
invalidate_paths: '/uid2SecureSignal.js'
8079
aws_account_id: ${{ vars.AWS_ACCOUNT_ID }}
@@ -83,7 +82,6 @@ jobs:
8382
- name: Deploy EUID Secure Signals to CDN
8483
uses: ./.github/actions/cdn_deployment_aws
8584
with:
86-
environment: ${{ matrix.environment }}
8785
artifact: ${{ (matrix.environment == 'integ' && 'development') || matrix.environment }}EuidSecureSignalScript
8886
invalidate_paths: '/euidSecureSignal.js'
8987
aws_account_id: ${{ vars.EUID_AWS_ACCOUNT_ID }}
Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
name: Release UID2/EUID Secure Signal Package to CDN (Five Environments)
2+
run-name: ${{ github.action_ref == 'refs/head/main' && 'Release' || 'Publish Pre-release' }} UID2/EUID Secure Signal Package to CDN (Five Environments) by @${{ github.actor }}
3+
4+
on:
5+
workflow_dispatch:
6+
7+
env:
8+
WORKING_DIR: ./
9+
10+
jobs:
11+
verify:
12+
runs-on: ubuntu-latest
13+
outputs:
14+
uid2_modified: ${{ steps.verify_uid2.outputs.any_modified }}
15+
euid_modified: ${{ steps.verify_euid.outputs.any_modified }}
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Check for change to src/secureSignalUid2.ts
19+
id: verify_uid2
20+
uses: tj-actions/changed-files@v41
21+
with:
22+
files: src/secureSignalUid2.ts
23+
- name: Check for change to src/secureSignalEuid.ts
24+
id: verify_euid
25+
uses: tj-actions/changed-files@v41
26+
with:
27+
files: src/secureSignalEuid.ts
28+
29+
build:
30+
needs: [verify]
31+
runs-on: ubuntu-latest
32+
strategy:
33+
matrix:
34+
node-version: [20.x]
35+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
36+
target: [development, production]
37+
38+
steps:
39+
- uses: actions/checkout@v4
40+
- name: Use Node.js ${{ matrix.node-version }}
41+
uses: actions/setup-node@v4
42+
with:
43+
node-version: ${{ matrix.node-version }}
44+
cache: 'npm'
45+
cache-dependency-path: ${{ env.WORKING_DIR }}/package-lock.json
46+
- name: Install dependencies
47+
run: npm install
48+
- name: Build
49+
run: npm run build:esp -- --mode=${{ matrix.target }}
50+
- name: Upload UID2 Secure Signals Files
51+
uses: actions/upload-artifact@v4
52+
with:
53+
name: ${{ matrix.target }}Uid2SecureSignalScript
54+
path: ./dist/uid2SecureSignal.js
55+
- name: Upload EUID Secure Signals Files
56+
uses: actions/upload-artifact@v4
57+
with:
58+
name: ${{ matrix.target }}EuidSecureSignalScript
59+
path: ./dist/euidSecureSignal.js
60+
61+
# Test Environment - UID2 only (first deployment)
62+
deployment-test:
63+
needs: [build]
64+
runs-on: ubuntu-latest
65+
permissions:
66+
id-token: write
67+
environment: test
68+
steps:
69+
- uses: actions/checkout@v4
70+
- name: Deploy UID2 Secure Signals to Test CDN
71+
uses: ./.github/actions/cdn_deployment_aws
72+
with:
73+
artifact: developmentUid2SecureSignalScript
74+
invalidate_paths: '/uid2SecureSignal.js'
75+
aws_account_id: ${{ secrets.AWS_ACCOUNT_ID }}
76+
aws_bucket_name: ${{ secrets.S3_BUCKET }}
77+
aws_distribution_id: ${{ secrets.AWS_DISTRIBUTION_ID }}
78+
79+
approval-to-deploy:
80+
name: Approval To Deploy to All Environments
81+
needs: [deployment-test]
82+
runs-on: ubuntu-latest
83+
environment: production
84+
steps:
85+
- name: Approval to deploy
86+
shell: bash
87+
run: echo "Approved for deployment to all environments"
88+
89+
# UID2 Integration Environment
90+
deployment-uid2-integ:
91+
needs: [build, approval-to-deploy]
92+
runs-on: ubuntu-latest
93+
permissions:
94+
id-token: write
95+
environment: uid2-integ
96+
steps:
97+
- uses: actions/checkout@v4
98+
- name: Deploy UID2 Secure Signals to Integration CDN
99+
uses: ./.github/actions/cdn_deployment_aws
100+
with:
101+
artifact: developmentUid2SecureSignalScript
102+
invalidate_paths: '/uid2SecureSignal.js'
103+
aws_account_id: ${{ secrets.AWS_ACCOUNT_ID }}
104+
aws_bucket_name: ${{ secrets.S3_BUCKET }}
105+
aws_distribution_id: ${{ secrets.AWS_DISTRIBUTION_ID }}
106+
107+
# UID2 Production Environment
108+
deployment-uid2-prod:
109+
needs: [build, approval-to-deploy]
110+
runs-on: ubuntu-latest
111+
permissions:
112+
id-token: write
113+
environment: uid2-prod
114+
steps:
115+
- uses: actions/checkout@v4
116+
- name: Deploy UID2 Secure Signals to Production CDN
117+
uses: ./.github/actions/cdn_deployment_aws
118+
with:
119+
artifact: productionUid2SecureSignalScript
120+
invalidate_paths: '/uid2SecureSignal.js'
121+
aws_account_id: ${{ secrets.AWS_ACCOUNT_ID }}
122+
aws_bucket_name: ${{ secrets.S3_BUCKET }}
123+
aws_distribution_id: ${{ secrets.AWS_DISTRIBUTION_ID }}
124+
125+
# EUID Integration Environment
126+
deployment-euid-integ:
127+
needs: [build, approval-to-deploy]
128+
runs-on: ubuntu-latest
129+
permissions:
130+
id-token: write
131+
environment: euid-integ
132+
steps:
133+
- uses: actions/checkout@v4
134+
- name: Deploy EUID Secure Signals to Integration CDN
135+
uses: ./.github/actions/cdn_deployment_aws
136+
with:
137+
artifact: developmentEuidSecureSignalScript
138+
invalidate_paths: '/euidSecureSignal.js'
139+
aws_account_id: ${{ secrets.AWS_ACCOUNT_ID }}
140+
aws_bucket_name: ${{ secrets.S3_BUCKET }}
141+
aws_distribution_id: ${{ secrets.AWS_DISTRIBUTION_ID }}
142+
143+
# EUID Production Environment
144+
deployment-euid-prod:
145+
needs: [build, approval-to-deploy]
146+
runs-on: ubuntu-latest
147+
permissions:
148+
id-token: write
149+
environment: euid-prod
150+
steps:
151+
- uses: actions/checkout@v4
152+
- name: Deploy EUID Secure Signals to Production CDN
153+
uses: ./.github/actions/cdn_deployment_aws
154+
with:
155+
artifact: productionEuidSecureSignalScript
156+
invalidate_paths: '/euidSecureSignal.js'
157+
aws_account_id: ${{ secrets.AWS_ACCOUNT_ID }}
158+
aws_bucket_name: ${{ secrets.S3_BUCKET }}
159+
aws_distribution_id: ${{ secrets.AWS_DISTRIBUTION_ID }}

0 commit comments

Comments
 (0)