What's Under the Hood of My Blog?

This post on social media

Some time ago, I promised to explain the technical side of how I build, publish and keep my blog running.

I chose a framework called Astro to build my blog. As the framework’s own website puts it: Astro is a JavaScript web framework optimized for building fast, content-driven websites. That sounds like a perfect fit for a blog. Yes, I had to learn yet another framework! But once you already know more than three dozen programming languages, learning a new dialect is no big deal.

Now, however, creating a new post is quick and easy: I simply put everything into a Markdown file that follows a predefined schema (see photo 2).

I use Yandex Cloud for source code, CI/CD, DNS, hosting, certificates and so on. The source code is stored in SourceCraft, and every push triggers SourceCraft’s built-in CI/CD pipeline, which does the following (see photo 3):

  • Uses the required Docker image to build a static version of the blog—and of my portfolio site, but that is a story for another day;
  • Installs AWS CLI in the image and uses it to upload the built sites to a dedicated S3 bucket;
  • Installs Yandex’s yc command-line utility, which I use to purge the Yandex Cloud CDN cache.

Now for a few details.

I host my DNS zones in Yandex Cloud. The integration between Cloud DNS and Certificate Manager is particularly convenient: configure the correct CNAME record, and a wildcard certificate from Let’s Encrypt is issued and renewed automatically.

I created three buckets in Object Storage for the blog. The first holds the media files used in posts—photographs, documents, presentations and videos. A CDN sits in front of this bucket and makes the content available.

Another bucket is for technical purposes. The CI/CD pipeline uploads each new version of the blog site to a separate directory named after the build time (see photo 4). If the upload succeeds, the main blog bucket switches atomically to the uploaded version. A lifecycle policy on the technical bucket automatically removes directories older than two weeks. The main bucket, naturally, also sits behind a CDN.

And now for the most interesting part: how much does all this cost? Hosting the DNS zones is the most expensive item at around four roubles a day (see the first photo). Object Storage costs no more than one and a half roubles, while the CDN costs 20–30 kopecks. SourceCraft, the cloud servers used for CI/CD, certificates, IAM and everything else cost NOTHING!!!

P.S. The SourceCraft team say that SourceCraft will become a paid service in the new year. I will see how reasonable the price is and then decide what to do next.

  • Cost of Yandex Cloud services
  • Creating a Markdown post using VSCodium
  • CI/CD pipeline in progress
  • Technical bucket in S3 object storage