Publish Pre-release UID2 Secure Signal Package to CDN by @mcollins-ttd #147
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 | |
run-name: ${{ github.action_ref == 'refs/head/main' && 'Release' || 'Publish Pre-release' }} UID2 Secure Signal Package to CDN by @${{ github.actor }} | |
on: | |
push: | |
branches: | |
- main | |
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/secureSignal.ts | |
id: verify | |
uses: tj-actions/changed-files@v41 | |
with: | |
files: src/secureSignal.ts | |
build: | |
needs: [verify] | |
if: needs.verify.outputs.is_any_file_modified == '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: | |
- 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 }} |