|
1 | | -name: CDN Deployment for AWS |
2 | | -description: Deploys to AWS CDN and optionally invalidates the path in CloudFront |
3 | | -inputs: |
4 | | - artifact: |
5 | | - description: Name of the artifact |
6 | | - required: true |
7 | | - invalidate_paths: |
8 | | - description: paths that get invalidated in cloud front |
9 | | - default: '' |
10 | | - aws_account_id: |
11 | | - description: The AWS account id |
12 | | - required: true |
13 | | - aws_distribution_id: |
14 | | - description: The CloudFront description id |
15 | | - required: true |
16 | | - aws_bucket_name: |
17 | | - description: The AWS bucket to sync |
18 | | - required: true |
19 | | - deploy_index_html: |
20 | | - description: Deploy a simple index.html file to S3 root |
21 | | - default: 'false' |
22 | | -runs: |
23 | | - using: 'composite' |
24 | | - |
25 | | - steps: |
26 | | - - name: Configure AWS credentials |
27 | | - uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4 |
28 | | - with: |
29 | | - aws-region: us-east-2 |
30 | | - role-to-assume: arn:aws:iam::${{ inputs.aws_account_id }}:role/github-runner-for-cdn |
31 | | - |
32 | | - - name: Check Identity |
33 | | - shell: bash |
34 | | - run: aws sts get-caller-identity |
35 | | - |
36 | | - - uses: actions/download-artifact@v4 |
37 | | - with: |
38 | | - name: ${{ inputs.artifact }} |
39 | | - path: ./download |
40 | | - |
41 | | - - name: Deploy |
42 | | - shell: bash |
43 | | - run: aws s3 sync ./download s3://${{ inputs.aws_bucket_name }} |
44 | | - |
45 | | - - name: Create and Deploy Index HTML |
46 | | - if: ${{ inputs.deploy_index_html == 'true' }} |
47 | | - shell: bash |
48 | | - run: | |
49 | | - echo '<!DOCTYPE html> |
50 | | - <html lang="en"> |
51 | | - <head> |
52 | | - <meta charset="UTF-8"> |
53 | | - <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
54 | | - <title>UID2/EUID SDK Files</title> |
55 | | - <style> |
56 | | - body { font-family: Arial, sans-serif; margin: 40px; } |
57 | | - h1 { color: #333; } |
58 | | - .file-list { margin: 20px 0; } |
59 | | - .file-item { margin: 10px 0; padding: 10px; background: #f5f5f5; border-radius: 5px; } |
60 | | - .file-link { text-decoration: none; color: #0066cc; font-weight: bold; } |
61 | | - .file-link:hover { text-decoration: underline; } |
62 | | - </style> |
63 | | - </head> |
64 | | - <body> |
65 | | - <h1>UID2/EUID SDK Files</h1> |
66 | | - <p>This directory contains the latest SDK files for UID2 and EUID integration.</p> |
67 | | - <div class="file-list"> |
68 | | - <div class="file-item"> |
69 | | - <strong>SDK Files:</strong> Available in this directory |
70 | | - </div> |
71 | | - <div class="file-item"> |
72 | | - <strong>Documentation:</strong> <a href="https://unifiedid.com/docs/guides/summary-guides" target="_blank" class="file-link">Visit Documentation</a> |
73 | | - </div> |
74 | | - </div> |
75 | | - </body> |
76 | | - </html>' > index.html |
77 | | - aws s3 cp index.html s3://${{ inputs.aws_bucket_name }}/index.html |
78 | | -
|
79 | | - - name: Invalidate CloudFront |
80 | | - uses: chetan/invalidate-cloudfront-action@cacab256f2bd90d1c04447a7d6afdaf6f346e7b3 # v2 |
81 | | - env: |
82 | | - DISTRIBUTION: ${{ inputs.aws_distribution_id }} |
83 | | - PATHS: ${{ inputs.invalidate_paths }} |
84 | | - AWS_REGION: us-east-2 |
| 1 | +name: CDN Deployment for AWS |
| 2 | +description: Deploys to AWS CDN and optionally invalidates the path in CloudFront |
| 3 | +inputs: |
| 4 | + artifact: |
| 5 | + description: Name of the artifact |
| 6 | + required: true |
| 7 | + invalidate_paths: |
| 8 | + description: paths that get invalidated in cloud front |
| 9 | + default: '' |
| 10 | + aws_account_id: |
| 11 | + description: The AWS account id |
| 12 | + required: true |
| 13 | + aws_distribution_id: |
| 14 | + description: The CloudFront description id |
| 15 | + required: true |
| 16 | + aws_bucket_name: |
| 17 | + description: The AWS bucket to sync |
| 18 | + required: true |
| 19 | + deploy_index_html: |
| 20 | + description: Deploy a simple index.html file to S3 root |
| 21 | + default: 'false' |
| 22 | +runs: |
| 23 | + using: 'composite' |
| 24 | + |
| 25 | + steps: |
| 26 | + - name: Configure AWS credentials |
| 27 | + uses: aws-actions/configure-aws-credentials@e7f100cf4c008499ea8adda475de1042d6975c7b # v6.2.0 |
| 28 | + with: |
| 29 | + aws-region: us-east-2 |
| 30 | + role-to-assume: arn:aws:iam::${{ inputs.aws_account_id }}:role/github-runner-for-cdn |
| 31 | + |
| 32 | + - name: Check Identity |
| 33 | + shell: bash |
| 34 | + run: aws sts get-caller-identity |
| 35 | + |
| 36 | + - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 |
| 37 | + with: |
| 38 | + name: ${{ inputs.artifact }} |
| 39 | + path: ./download |
| 40 | + |
| 41 | + - name: Deploy |
| 42 | + shell: bash |
| 43 | + run: aws s3 sync ./download s3://${{ inputs.aws_bucket_name }} |
| 44 | + |
| 45 | + - name: Create and Deploy Index HTML |
| 46 | + if: ${{ inputs.deploy_index_html == 'true' }} |
| 47 | + shell: bash |
| 48 | + run: | |
| 49 | + echo '<!DOCTYPE html> |
| 50 | + <html lang="en"> |
| 51 | + <head> |
| 52 | + <meta charset="UTF-8"> |
| 53 | + <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 54 | + <title>UID2/EUID SDK Files</title> |
| 55 | + <style> |
| 56 | + body { font-family: Arial, sans-serif; margin: 40px; } |
| 57 | + h1 { color: #333; } |
| 58 | + .file-list { margin: 20px 0; } |
| 59 | + .file-item { margin: 10px 0; padding: 10px; background: #f5f5f5; border-radius: 5px; } |
| 60 | + .file-link { text-decoration: none; color: #0066cc; font-weight: bold; } |
| 61 | + .file-link:hover { text-decoration: underline; } |
| 62 | + </style> |
| 63 | + </head> |
| 64 | + <body> |
| 65 | + <h1>UID2/EUID SDK Files</h1> |
| 66 | + <p>This directory contains the latest SDK files for UID2 and EUID integration.</p> |
| 67 | + <div class="file-list"> |
| 68 | + <div class="file-item"> |
| 69 | + <strong>SDK Files:</strong> Available in this directory |
| 70 | + </div> |
| 71 | + <div class="file-item"> |
| 72 | + <strong>Documentation:</strong> <a href="https://unifiedid.com/docs/guides/summary-guides" target="_blank" class="file-link">Visit Documentation</a> |
| 73 | + </div> |
| 74 | + </div> |
| 75 | + </body> |
| 76 | + </html>' > index.html |
| 77 | + aws s3 cp index.html s3://${{ inputs.aws_bucket_name }}/index.html |
| 78 | +
|
| 79 | + - name: Invalidate CloudFront |
| 80 | + uses: chetan/invalidate-cloudfront-action@cacab256f2bd90d1c04447a7d6afdaf6f346e7b3 # v2 |
| 81 | + env: |
| 82 | + DISTRIBUTION: ${{ inputs.aws_distribution_id }} |
| 83 | + PATHS: ${{ inputs.invalidate_paths }} |
| 84 | + AWS_REGION: us-east-2 |
0 commit comments