generated from az-digital/template
-
Notifications
You must be signed in to change notification settings - Fork 2
28 lines (28 loc) · 1.37 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
name: Deploy CDN assets for release
run-name: Deploy CDN assets to the `${{ github.event.client_payload.version }}` and `latest` buckets
on:
repository_dispatch:
types: az_icons_release
jobs:
deploy:
name: 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: us-west-2
- name: Deploy CDN assets to S3 + CloudFront
run: |
aws s3 sync --delete --cache-control max-age=691200 dist/. s3://${{ secrets.AZ_DIGITAL_CDN_BUCKET }}/lib/az-icons/${{ github.event.client_payload.version }}/
aws cloudfront create-invalidation --distribution-id ${{ secrets.AZ_DIGITAL_CDN }} --paths /lib/az-icons/${{ github.event.client_payload.version }}/*
- name: Update 'latest' CDN assets to S3 + CloudFront
run: |
aws s3 sync --delete --cache-control max-age=691200 dist/. s3://${{ secrets.AZ_DIGITAL_CDN_BUCKET }}/lib/az-icons/latest/
aws cloudfront create-invalidation --distribution-id ${{ secrets.AZ_DIGITAL_CDN }} --paths /lib/az-icons/latest/*