Build a Website in Azure using GitHub Actions, Jekyll and Terraform Cloud.
Build a Website with an Azure Static Web App and use GitHub Actions to manage your continuous deployment with Terraform Cloud for Infrastructure and Jekyll to generate your static website content.
Category:DevOps
Date:13 May 2023
I have been looking at moving away from Square Space and thought I would look at free hosting options.
There’s multiple options out there, such as AWS S3 buckets, Azure Storage Accounts, Azure Static Web App and GitHub Pages. These days, you don’t even need to purchase a domain name, GitHub pages is probably the more favoured option as you get a username.github.io domain name if you didn’t want to pay for a custom domain name!
But I thought I would create this video and show all the technologies used in the real world today. The workflow in this video is a very common approach in today’s world working with Cloud technologies. Initially there will be manual processes to setup the accounts and integration but once set up, its as easy as just pushing code to make future updates!
Not to mention that this is a foundation where by you can enhance with A/B deployments, include throughout checks and testing before deploying, enforcing security controls or even scanning for bad practices!
Really this is quite an over engineered scenario for your own personal page but its a fun project to learn different technologies and how they integrate!
Find the newly created repository and Click Settings
Under Security, Select Secrets and Variables then Select Actions
Under Secrets, Select New Repository Secret
Enter a Name for the Secret (example is TF_API_TOKEN)
In the Secret box, Paste the above API Token
Click Add Secret
Now you should have a new secret under Repository Secrets
8. Setup Your Repository with the Demo Code
So next up, we will write some simple Terraform code to deploy the resource group and static web app.
Clone my repository which has all the Terraform code and GitHub Actions Workflow.
Copy the .github/workflows/website-automation.txt folder to your NEW REPOSITORY
Rename the file website-automation.txt to website-automation.yaml (this was named as a txt so my repo does try and the GitHub Actions Workflow everytime!)
9. Build a Jekyll Website
This is an option step, you can choose software of your choice. Once you have website code, it will need to be updated to the /src folder in your repository. The following steps are from the Jekyll - Quick Start page. This was run on WSL Ubuntu.
You can also get Jekyll templates from here. We’ll be using the Jekflix Template in this demo.
Install Gem and Jekyll by running:
sudo gem install jekyll bundler
Browse to a temp directory. This will become your local website development directory
And that is it! You should now have a new website and this is generally how infrastructure and applications are managed in larger environments. Obviously there’s more controls such a code approvers, tighter security controls around access and networking but this was a cool project to experience multiple technologies and did I mention.. everything is free!
I share with you my experience in taking the AZ-500 Microsoft Azure Security Technologies Exam in 2023. I will talk about the Cyber Security certifcation path, details around the exam, things to consider and tips if you plan on taking the exam!