Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rickzkm/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
https://github.com/rickzkm/jekyll-to-aws-s3-deployment-script

aws aws-cli aws-s3 command-line deploy deployment jamstack jekyll python

Last synced: about 4 hours ago
JSON representation

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

Awesome Lists containing this project

README

        

# 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:

```bash
git clone https://github.com/rickzkm/jekyll-to-aws-s3-deployment-script.git
```

2. Navigate to the repository directory:

```bash
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:

```bash
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:

```bash
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:

```bash
./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!