jekyll-to-aws-s3-deployment-script

jekyll-to-aws-s3-deployment-script

This is my handy Python script that runs deployment of Jekyll static site to AWS S3 and invalidates CloudFront

My Jekyll Website AWS S3 Deployment Script

This repository contains a deployment script for the My Jekyll Website, simplifying the process of updating dependencies, building the website and deploying it onto AWS S3. The script automates the deployment workflow, including dependency updates and CloudFront cache invalidation, ensuring users receive the latest version of the website after deployment.

Usage

  1. Clone the repository:

    git clone https://github.com/rickzkm/jekyll-to-aws-s3-deployment-script.git
    
  2. Navigate to the repository directory:

    cd jekyll-to-aws-s3-deployment-script
    
  3. Make sure you have the necessary prerequisites installed:

    • Git
    • Ruby
    • Bundler
    • Jekyll
    • AWS CLI
  4. Modify the configuration variables in the script according to your environment:

    REPO_URL="https://github.com/myrepository/jekyllwebsite"
    BRANCH="main"
    S3_BUCKET="s3://jekyllwebsite.app"
    CF_DIST_ID="YOUR_CLOUDFRONT_ID"
    WEBSITE_DIR="/path/to/jekyllwebsite/website"
    
  5. Set the AWS access key ID and secret access key as environment variables:

    export AWS_ACCESS_KEY_ID="YOUR_AWS_ACCESS_KEY_ID"
    export AWS_SECRET_ACCESS_KEY="YOUR_AWS_SECRET_ACCESS_KEY"
    
  6. Run the deployment script:

    ./deploy.sh
    

Configuration

  • REPO_URL: The URL of your Jekyll Website repository.
  • BRANCH: The branch from which to fetch updates. For me it's the Main branch.
  • S3_BUCKET: The S3 bucket where the website will be deployed.
  • CF_DIST_ID: The CloudFront distribution ID for invalidation.
  • WEBSITE_DIR: The directory where your Jekyll website is located.

License

Feel free to change, customise and modify without any limitations. Just remember, with great power comes great... well, you get the idea. Be kind to your fellow developers, play nice with the code, and above all, have fun!