My personal blog running on Gatsby.
There's a Linux devcontainer in this repo, it's really slow with real-time updates from filesystem, windows direct development is much smoother.
Clone this repository.
Install nodejs 14.2.0 (yes, I'm in dependency hell and don't want to upgrade) via choco:
choco install nodejs.install --version=14.2.0 -y --force
node --version
# v14.2.0
Install Gatsby with npm install -g gatsby-cli@2.12.21
.
cd
into the root directory of the cloned repository and run npm install
to install all site dependencies - this takes a few minutes grabbing all the packages in yarn.lock
.
Run gatsby develop
to build and start a local development server.
View the site at localhost:8000
, with graphql endpoint at localhost:8000/___graphql
To view a production version of the site, run: gatsby clean; gatsby build; gatsby serve
and view at localhost:9000
Get a fresh new WSL machine up:
# Delete old WSL
wsl --unregister Ubuntu-24.04
# Create new WSL
wsl --install -d Ubuntu-24.04
Open VS Code in the WSL:
code .
Clone the repo, and open VSCode in it:
cd ~/
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
git clone https://github.com/mdrakiburrahman/rakirahman.me.git
cd rakirahman.me/
code .
Create a new branch, if required:
git checkout -b dev/mdrrahman/branch-name
Run the bootstrapper script, that installs all tools idempotently:
GIT_ROOT=$(git rev-parse --show-toplevel)
chmod +x ${GIT_ROOT}/.scripts/bootstrap-dev-env.sh && ${GIT_ROOT}/.scripts/bootstrap-dev-env.sh
Get the website up at localhost:8000
:
source ~/.bashrc
gatsby develop
Pushing code into this repository triggers two GitHub Actions:
Purge Azure CDN
: which clears the Azure CDN cached content via purgingDeploy Website to Azure Storage Account
: which builds the static site with gatsby build
, and uploads content to an Azure Storage Account - where the site is being hosted.This project is open source and available under the MIT License