Release UID2/EUID Secure Signal Package to CDN #117
Workflow file for this run
This file contains 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: Release UID2 Secure Signal Package to CDN | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
env: | |
WORKING_DIR: ./ | |
jobs: | |
verify: | |
runs-on: ubuntu-latest | |
outputs: | |
isAnyFileModified: ${{ steps.verify.outputs.any_modified }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check for change to src/secureSignal.ts | |
id: verify | |
uses: tj-actions/changed-files@v41 | |
with: | |
files: src/secureSignal.ts | |
build: | |
needs: [verify] | |
if: needs.verify.outputs.isAnyFileModified != 'true' | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.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 }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.target }}SecureSignalScript | |
path: ./dist/uid2SecureSignal.js | |
deployment: | |
needs: [build] | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
strategy: | |
matrix: | |
environment: [Integ, production] | |
environment: ${{ matrix.environment }} | |
steps: | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-region: us-east-2 | |
role-to-assume: arn:aws:iam::475720075663:role/github-runner-for-cdn | |
- name: Check Identity | |
shell: bash | |
run: aws sts get-caller-identity | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/cdn_deployment_aws | |
with: | |
environment: ${{ matrix.environment }} | |
artifact: ${{ (matrix.environment == 'Integ' && 'development') || matrix.environment }}SecureSignalScript | |
invalidate_paths: '/uid2SecureSignal.js' | |
aws_bucket_name: ${{ vars.S3_BUCKET }} | |
aws_distribution_id: ${{ secrets.AWS_DISTRIBUTION_ID }} |