This post refers to a previous version of my site that used GatsbyJS, prior to January 2021.
I purchased my domain last year to host a blog and email. I did not expect to start producing a lot of posts so I wanted the blog itself to be as inexpensive as possible. Here we are about 10 months later.
I started looking at static HTML generators like MKDocs, GitBook and Jekyl after finding a few sites that used them.They look like novel, modern and new ways to generate sites, and far beyond my mediocre HTML skills. I wanted to deploy the site using Azure to gain experience with some DevOps workflows.
I built a blog with GatsbyJS based on a tutorial by Elena Neroslavskaya that was very helpful.
The workflow is:
- Install node.js and generate a Gatsby site
- customize and commit to a Git repository
- use Azure pipelines to monitor the desired branch, build site files and deploy to an Azure Storage Account
- use Azure CDN to quickly and cheaply serve the site globally
And it all worked great. Managing SSL certs through Azure CDN was a challenge that took a lot of time to resolve, but I expect it will be reliable. The site has been cheap to run. What bothered me was managing my development environment, meaning Node.js and the project files from my Github. If I wanted to develop at home on a workstation and then edit while at work using a more portable laptop, both systems had to have matching configurations and I needed to be good about managing my repo commits. Since this was a group of new tools and techniques for me, I struggled.
I attended a Visual Studio Online session at Ignite 2019.
This is an Azure-hosted development environment that can be accessed via browser or Visual Studio Code. The selling point for me was the isolated development environment usecase. Instead of trying to maintain updates and avoid conflicts in a local environment, I build a new development environment when I need it, point it at my GitHub repo and configure it via script to install the tools I use. In my case:
Updated 5/2/2020, Visual Studio Codespaces is the new name.
#!/bin/bash
# postcreate.sh
sudo apt-get update
npm install -g gatsby-cli
npm install
Now I can work on my Gatsby website anywhere, even access forwarded ports from localhost, and if the remote environment stops working, I can blow it away and start over. A small thing, but very satisfying for me.