-
Notifications
You must be signed in to change notification settings - Fork 8
33 lines (30 loc) · 1.31 KB
/
cdn-deploy-head.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
name: Build & deploy CDN assets (HEAD)
run-name: Build & deploy CDN assets for `${{ github.ref_name }}` branch update.
on:
push:
branches:
- main
- 2.x
jobs:
deploy:
name: Build & deploy CDN assets
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
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 2.x CDN assets to S3 + CloudFront
if: ${{ github.ref_name == '2.x' }}
run: |
aws s3 sync --cache-control max-age=691200 dist/ s3://${{ secrets.AZ_DIGITAL_CDN_BUCKET }}/lib/arizona-bootstrap/2.x/
aws cloudfront create-invalidation --distribution-id ${{ secrets.AZ_DIGITAL_CDN }} --paths /lib/arizona-bootstrap/2.x/*
- name: Deploy 5.x CDN assets to S3 + CloudFront
if: ${{ github.ref_name == 'main' }}
run: |
aws s3 sync --cache-control max-age=691200 dist/ s3://${{ secrets.AZ_DIGITAL_CDN_BUCKET }}/lib/arizona-bootstrap/5.x/
aws cloudfront create-invalidation --distribution-id ${{ secrets.AZ_DIGITAL_CDN }} --paths /lib/arizona-bootstrap/5.x/*