Build & deploy CDN assets for 2.0.27
release.
#24
This file contains 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: 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: us-west-2 | |
- 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/* |