-
Notifications
You must be signed in to change notification settings - Fork 8
40 lines (34 loc) · 1.88 KB
/
cdn-deploy-release.yml
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
name: Build & deploy CDN assets
run-name: Build & deploy CDN assets for `${{ github.event.client_payload.version }}` release.
on:
repository_dispatch:
types: az_bootstrap_release
jobs:
deploy:
name: Build & deploy CDN assets
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.client_payload.ref }}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Deploy CDN assets to S3 + CloudFront
run: |
aws s3 sync --cache-control max-age=691200 dist/ s3://${{ secrets.AZ_DIGITAL_CDN_BUCKET }}/lib/arizona-bootstrap/${{ github.event.client_payload.version }}/
aws cloudfront create-invalidation --distribution-id ${{ secrets.AZ_DIGITAL_CDN }} --paths /lib/arizona-bootstrap/${{ github.event.client_payload.version }}/*
- name: Update 'latest-2.x' CDN assets to S3 + CloudFront
if: ${{ github.event.client_payload.branch == '2.x' }}
run: |
aws s3 sync --cache-control max-age=691200 dist/ s3://${{ secrets.AZ_DIGITAL_CDN_BUCKET }}/lib/arizona-bootstrap/latest-2.x/
aws cloudfront create-invalidation --distribution-id ${{ secrets.AZ_DIGITAL_CDN }} --paths /lib/arizona-bootstrap/latest-2.x/*
- name: Update 'latest-5.x' CDN assets to S3 + CloudFront
if: ${{ github.event.client_payload.branch == 'main' }}
run: |
aws s3 sync --cache-control max-age=691200 dist/ s3://${{ secrets.AZ_DIGITAL_CDN_BUCKET }}/lib/arizona-bootstrap/latest-5.x/
aws cloudfront create-invalidation --distribution-id ${{ secrets.AZ_DIGITAL_CDN }} --paths /lib/arizona-bootstrap/latest-5.x/*