Deployed my personal blog using Route 53
and Github action
.
Lets take this process into two step:
- Github Action
- Route 53
1️⃣ Github Action 🧨
This GitHub Action will run gatsby build
at the root of your repository and deploy it to GitHub Pages for you!
Create .github
folder in root of the project and under .github
folder create workflows
folder. Then add the below snippet into main.yml
.github/workflows/main.yml:
name: Gatsby Publish
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: enriikke/gatsby-gh-pages-action@v2
with:
access-token: ${{ secrets.PERSONAL_BLOG }}
deploy-branch: gh-pages
Configure the access-token 🎗
- Open github website with the repo (e.x: https://github.com/suprabhasupi/blog)
-
Enter the name and Value, Get the value by:
- Click on Profile settings
- Click on
developer settings
which is in left tab (include image) - Click on Personal Access Token
- Click on
Generate new token
button - Give
Note
name - In Select scopes, checked
repo
- Click
Generate token
button - Now, Copy the value
Paste the value into
New Secret
ValueNow, Use the Secret name and place into the project
You can see the below image where I have used the same secret name into the main.yml
file.
Once you push code into master, You can see the deployment status into Actions
tab.
You can check the status as pass ✅ and fail ❌ in actions.
2️⃣ Configure AWS Route 53 🚀
- Log into the AWS console and go to the Route 53 dashboard.
Click the domain you would like to use or create new hosted zone
Click Create Record Set
-
Enter the following four IP addresses into the value text area. Then click Save Record Set.
185.199.108.153 185.199.109.153 185.199.110.153 185.199.111.153
Yeah, this is it. Now you can check your live website on the URL which you have mentioned into route53 🜸.