Publish Pre-release UID2/EUID Secure Signal Package to CDN (Five Environments) by @clarkxuyang #3
Workflow file for this run
This file contains hidden or 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 Secure Signal Package to CDN (v2) | |
| run-name: ${{ github.action_ref == 'refs/head/main' && 'Release' || 'Publish Pre-release' }} UID2/EUID Secure Signal Package to CDN (Five Environments) by @${{ github.actor }} | |
| on: | |
| workflow_dispatch: | |
| env: | |
| WORKING_DIR: ./ | |
| jobs: | |
| verify: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| uid2_modified: ${{ steps.verify_uid2.outputs.any_modified }} | |
| euid_modified: ${{ steps.verify_euid.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 | |
| # Test Environment - UID2 only (first deployment) | |
| deployment-test: | |
| needs: [build] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| environment: uid2-test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Deploy UID2 Secure Signals to Test CDN | |
| uses: ./.github/actions/cdn_deployment_aws | |
| with: | |
| artifact: developmentUid2SecureSignalScript | |
| invalidate_paths: '/uid2SecureSignal.js' | |
| aws_account_id: ${{ secrets.AWS_ACCOUNT_ID }} | |
| aws_bucket_name: ${{ secrets.S3_BUCKET }} | |
| aws_distribution_id: ${{ secrets.AWS_DISTRIBUTION_ID }} | |
| approval-to-deploy: | |
| name: Approval To Deploy to All Environments | |
| needs: [deployment-test] | |
| runs-on: ubuntu-latest | |
| environment: approve-deployment | |
| steps: | |
| - name: Approval to deploy | |
| shell: bash | |
| run: echo "Approved for deployment to all environments" | |
| # Matrix Deployment for All Environments | |
| deployment-matrix: | |
| needs: [build, approval-to-deploy] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| strategy: | |
| matrix: | |
| include: | |
| # UID2 Environments | |
| - product: uid2 | |
| github_env: uid2-integ | |
| build_type: development | |
| file_name: uid2SecureSignal.js | |
| - product: uid2 | |
| github_env: uid2-prod | |
| build_type: production | |
| file_name: uid2SecureSignal.js | |
| # EUID Environments | |
| - product: euid | |
| github_env: euid-integ | |
| build_type: development | |
| file_name: euidSecureSignal.js | |
| - product: euid | |
| github_env: euid-prod | |
| build_type: production | |
| file_name: euidSecureSignal.js | |
| environment: ${{ matrix.github_env }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Deploy ${{ matrix.product == 'uid2' && 'UID2' || 'EUID' }} Secure Signals to ${{ matrix.build_type == 'development' && 'Integration' || 'Production' }} CDN | |
| uses: ./.github/actions/cdn_deployment_aws | |
| with: | |
| artifact: ${{ matrix.build_type }}${{ matrix.product == 'uid2' && 'Uid2' || 'Euid' }}SecureSignalScript | |
| invalidate_paths: '/${{ matrix.file_name }}' | |
| aws_account_id: ${{ secrets.AWS_ACCOUNT_ID }} | |
| aws_bucket_name: ${{ secrets.S3_BUCKET }} | |
| aws_distribution_id: ${{ secrets.AWS_DISTRIBUTION_ID }} |