Skip to content

Close #56 Update Dockerfile for new github actions workflow (#56) #20

Close #56 Update Dockerfile for new github actions workflow (#56)

Close #56 Update Dockerfile for new github actions workflow (#56) #20

name: Build & deploy CDN assets
on:
push:
branches:
- main
jobs:
deploy:
name: Build & deploy CDN assets
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- 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/main/
aws cloudfront create-invalidation --distribution-id ${{ secrets.AZ_DIGITAL_CDN }} --paths /lib/az-icons/main/*