Skip to content

Merge pull request #13 from dcginfra/new-design #12

Merge pull request #13 from dcginfra/new-design

Merge pull request #13 from dcginfra/new-design #12

Workflow file for this run

name: Deploy site
on:
push:
branches:
- 'master'
workflow_dispatch:
jobs:
deploy:
name: Deploy site to AWS S3
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-region: ${{ secrets.AWS_REGION }}
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
- name: Copy site to s3 with the AWS CLI
run: |
aws --region ${{ secrets.AWS_REGION }} s3 sync --acl private dist/ s3://${{ secrets.S3_BUCKET }}/${{ secrets.S3_PREFIX }}/
- name: Request CloudFront invalidation of all objects
run: |
aws --region ${{ secrets.AWS_REGION }} cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} --paths '/*'