Skip to content

Create deploy.yml

Create deploy.yml #1

Workflow file for this run

name: Deploy index.html to S3 + CloudFront
on:
push:
branches:
- main
permissions:
id-token: write
contents: read
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Configure AWS credentials (OIDC)
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::050227013539:role/GitHubDeployRole
aws-region: us-east-1
- name: Upload index.html to S3
run: |
aws s3 cp index.html s3://siddharth-gupta-test/index.html \
--cache-control "max-age=0,no-cache,no-store,must-revalidate" \
--content-type "text/html"
- name: Invalidate CloudFront cache
run: |
aws cloudfront create-invalidation \
--distribution-id E3AI1EJPXOOK6Z \
--paths "/*"