Skip to content

amitkumar0128/static-app-s3-cicd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌐 Static Website CI/CD on AWS S3 with GitHub Actions

This project demonstrates how to automatically deploy a static website to an Amazon S3 bucket using GitHub Actions on every push to the main branch.


πŸ“ Project Structure

static-app-s3-cicd/
β”œβ”€β”€ .github/
β”‚   └── workflows/
β”‚       └── main.yml        # GitHub Actions workflow
β”œβ”€β”€ index.html              # Homepage HTML
β”œβ”€β”€ styles.css              # Styling
β”œβ”€β”€ script.js               # Frontend JS
└── README.md               # Project documentation

πŸš€ Features

  • πŸ“¦ HTML, CSS, and JS static site
  • πŸ” Automatic deployment to AWS S3
  • πŸ” Uses GitHub Secrets for AWS credentials
  • 🧼 Syncs with --delete to remove stale files

βš™οΈ CI/CD Workflow

The GitHub Actions workflow does the following:

  1. βœ… Checks out the latest code from main
  2. πŸ” Configures AWS credentials from GitHub Secrets
  3. ☁️ Syncs the static site files to your S3 bucket

Workflow file: .github/workflows/main.yml

on:
  push:
    branches: [main]

🌩️ Prerequisites

  1. AWS S3 bucket – Create one and make it public/static-site enabled

  2. AWS IAM user with s3:PutObject, s3:DeleteObject, and s3:ListBucket permissions

  3. GitHub Secrets – Go to Settings β†’ Secrets and variables β†’ Actions, and add:

    • AWS_ACCESS_KEY_ID
    • AWS_SECRET_ACCESS_KEY

πŸ”§ How to Use

  1. Fork or clone this repository

  2. Replace contents of:

    • index.html, styles.css, and script.js with your own site
  3. Update the S3 bucket name in main.yml:

aws s3 sync . s3://<your-bucket-name> --delete
  1. Push to main β†’ GitHub Actions will deploy it automatically

🌍 Access Your Website

After a successful push, your static site will be available at:

http://<your-bucket-name>.s3-website-<region>.amazonaws.com

Example: http://jak-aws-bucket.s3-website-us-east-1.amazonaws.com


πŸ§ͺ Tech Stack

  • HTML / CSS / JS
  • AWS S3
  • GitHub Actions

πŸ“„ License

MIT License


πŸ™‹β€β™‚οΈ Author

Amit Kumar πŸ”— GitHub

About

A static Flask web app automatically deployed to AWS S3 via GitHub Actions CI/CD pipeline.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published