-
Notifications
You must be signed in to change notification settings - Fork 1
91 lines (82 loc) · 3.09 KB
/
secureSignal-cd.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Release UID2/EUID Secure Signal Package to CDN
run-name: ${{ github.action_ref == 'refs/head/main' && 'Release' || 'Publish Pre-release' }} UID2/EUID Secure Signal Package to CDN by @${{ github.actor }}
on:
workflow_dispatch:
env:
WORKING_DIR: ./
jobs:
verify:
runs-on: ubuntu-latest
outputs:
is_any_file_modified: ${{ steps.verify.outputs.any_modified }}
steps:
- uses: actions/checkout@v4
- name: Check for change to src/secureSignalUid2.ts
id: verify_uid2
uses: tj-actions/changed-files@v41
with:
files: src/secureSignalUid2.ts
- name: Check for change to src/secureSignalEuid.ts
id: verify_euid
uses: tj-actions/changed-files@v41
with:
files: src/secureSignalEuid.ts
build:
needs: [verify]
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
target: [development, production]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: ${{ env.WORKING_DIR }}/package-lock.json
- name: Install dependencies
run: npm install
- name: Build
run: npm run build:esp -- --mode=${{ matrix.target }}
- name: Upload UID2 Secure Signals Files
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}Uid2SecureSignalScript
path: ./dist/uid2SecureSignal.js
- name: Upload EUID Secure Signals Files
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}EuidSecureSignalScript
path: ./dist/euidSecureSignal.js
deployment:
needs: [build]
runs-on: ubuntu-latest
permissions:
id-token: write
strategy:
matrix:
environment: [integ, production]
environment: ${{ matrix.environment }}
steps:
- uses: actions/checkout@v4
- name: Deploy UID2 Secure Signals to CDN
uses: ./.github/actions/cdn_deployment_aws
with:
environment: ${{ matrix.environment }}
artifact: ${{ (matrix.environment == 'integ' && 'development') || matrix.environment }}Uid2SecureSignalScript
invalidate_paths: '/uid2SecureSignal.js'
aws_account_id: ${{ vars.AWS_ACCOUNT_ID }}
aws_bucket_name: ${{ vars.S3_BUCKET }}
aws_distribution_id: ${{ secrets.AWS_DISTRIBUTION_ID }}
- name: Deploy EUID Secure Signals to CDN
uses: ./.github/actions/cdn_deployment_aws
with:
environment: ${{ matrix.environment }}
artifact: ${{ (matrix.environment == 'integ' && 'development') || matrix.environment }}EuidSecureSignalScript
invalidate_paths: '/euidSecureSignal.js'
aws_account_id: ${{ vars.EUID_AWS_ACCOUNT_ID }}
aws_bucket_name: ${{ vars.EUID_S3_BUCKET }}
aws_distribution_id: ${{ secrets.EUID_AWS_DISTRIBUTION_ID }}