Deploy a Static HTML Site to AWS S3 with GitHub Actions
What You can push your static HTML files with their related assets to AWS S3 directly from GitHub Actions whenever you push to GitHub. How You will need an AWS IAM user with access to S3 and CloudFront (if you are going to use CloudFront), and an S3 bucket to deploy into. name: Deploy to S3 on: push: branches: - master jobs: deploy: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 with: submodules: false - name: Sync S3 bucket uses: jakejarvis/s3-sync-action@master with: args: --delete env: AWS_S3_BUCKET: your-bucket-name AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} AWS_REGION: 'us-west-1' SOURCE_DIR: '.' - name: Invalidate CloudFront uses: chetan/invalidate-cloudfront-action@v2 env: DISTRIBUTION: your-cf-id PATHS: "/*" AWS_REGION: "us-east-1" AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} If you are not using a CloudFront distribution to serve the S3 bucket, remove the Invalidate CloudFront step. ...