Jekyll onto the clouds!
So, I last attempted to setup a azure dev ops pipeline, to build my jekyll site into a web app, without complete success. I then investigated Azure Static Web Apps, which may well offer a suitable solution to hosting a blog/personal website.
As I had my jekyll site running locally, using a local docker image on my MacOS.
I followed these steps essentially:
Create the application
- Navigate to the Azure portal
- Select Create a Resource
- Search for Static Web Apps
- Select Static Web Apps
- Select Create
On the Basics tab, enter the following values.
- Property Value
- Subscription Your Azure subscription name.
- Resource group jekyll-static-app
- Name jekyll-static-app
- Plan type Free
- Region for Azure Functions API and staging environments Select a region closest to you.
- Source GitHub
Select Sign in with GitHub and authenticate with GitHub.
- Enter the following GitHub values.
- Property Value
- Organization Select your desired GitHub organization.
- Repository Select jekyll-static-app.
- Branch Select main.
In the Build Details section, select Custom from the Build Presets drop-down and keep the default values.
- In the App location box, enter ./.
- Leave the Api location box empty.
- In the Output location box, enter _site.
-
Review and create
- Select the Review + Create button to verify the details are all correct.
- Select Create to start the creation of the App Service Static Web App and provision a GitHub Action for deployment.
- Once the deployment completes click, Go to resource.
- On the resource screen, click the URL link to open your deployed application. You may need to wait a minute or two for the GitHub Action to complete.
and ending up with this file in my github repo under workflows/azure-static-web-apps-wonderful-forest-0453ab600.yml
Summary of the latest hosting setup
For now I’ll keep using Cloudflare Pages, as it’s tightly integrated with the DNS and CDN already in place, however I now have to ability to switch to another cloud provider should one fail, which is always handy.
AWS S3
For AWS, we have either a github action, such as this also an s3 server option. For the github based actions. the following workflow file would suffice:
Google Firebase - bonus
For completeness to my multicloud journey, I should next investigate google firebase, perhaps this blog will assist me. I should point out that now, github allows a single private repo on their free plan. Ok, here it is, using a docker container to setup firebase CLI
Then change directory into the /srv/jekyll directory, run
firebase login
copy/paste the URL into your browser, authorise the firebase CLI tools, then:
firebase init hosting
after a little testing, I found that the build command
- run: sudo gem install bundler && sudo bundle install --path vendor && bundle exec jekyll build
worked well, so the firebase-hosting-merge.yml ended up looking like