Skip to content

Deploy

Deploy #11

Workflow file for this run

name: Deploy
on:
push:
branches:
- main
workflow_dispatch:
permissions:
id-token: write
jobs:
deploy-s3:
runs-on: ubuntu-latest
steps:
- name: Create OIDC token to AWS
uses: aws-actions/configure-aws-credentials@v4
with:
audience: sts.amazonaws.com
aws-region: us-east-1
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT }}:role/${{ secrets.CI_IAM_ROLE }}
- name: Push to AWS S3
run: |
mkdir dist
printf "<h1>CloudFront deployment with GitHub Actions</h1>" > dist/index.html
aws s3 cp dist s3://${{ secrets.APP_BUCKET }} --recursive
aws cloudfront create-invalidation --distribution-id ${{ secrets.DISTRIBUTION_ID }} --paths "/*"