🚀 Deploying a Static Website to S3 Using GitHub CI/CD

🧠 Project Overview

Automated deployment of a static website to AWS S3 using GitHub Actions. Every push to the main branch triggers a CI/CD pipeline that securely syncs files to S3 using AWS CLI.

🛠 Technologies Used

⚙️ YAML Pipeline Configuration

name: Deploy to S3

on:
  push:
    branches:
      - main

jobs:
  deploy:
    runs-on: ubuntu-latest

    steps:
    - name: Checkout code
      uses: actions/checkout@v3

    - name: Configure AWS Credentials
      uses: aws-actions/configure-aws-credentials@v2
      with:
        aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
        aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
        aws-region: us-east-1

    - name: Sync Files to S3
      run: aws s3 sync . s3://${{ secrets.S3BUCKET }} \
           --exclude ".git/*" \
           --exclude "node_modules/*"

📌 Implementation Steps

  1. Create an S3 Bucket: Enable static website hosting.
  2. Add GitHub Workflow: Create .github/workflows/deploy.yml.
  3. Store AWS Secrets: Add access keys and bucket name to GitHub Secrets.
  4. Push to Main: Deployment runs automatically.

⚠️ Challenges Faced

✅ Final Outcome

Successfully built a fully automated CI/CD pipeline that eliminates manual deployments, ensures consistency, and keeps the website continuously updated.

← Back to Resume