New website
Welcome to my new website. I intend to use this space for sharing my learnings in Software Engineering. I think blogging is a great way to solidify knowledge and for professional development. And as a bonus, maybe this information will be helpful to others.
This website is built using Jekyll and the Chirpy theme by cotes2020. I chose to build my new site using this theme due to its no-nonsense approach to design and typographic layout, which I think lends itself perfectly to technical writing.
The site itself is hosted on Codeberg Pages. I’m interested in using as many community-based and open technologies as possible. I think Codeberg fits the bill nicely in this regard.
In terms of deploying this site, I want to keep things as efficient as possible. I will be building locally and publishing the built assets via another repository (as a Git submodule). I think this suits my use case as I don’t need to pull various Docker images, and (re)compile software for each build, which is normal in most “repeatable” CI/CD setups.
Building
Jekyll depends on Ruby, so this needs to be installed first, along with some additional development tools:
1
sudo dnf install ruby ruby-devel openssl-devel redhat-rpm-config gcc-c++ @development-tools
Once these have been installed, we can install the Ruby gems required for building the site:
1
gem install jekyll bundler
Installing the Gems results in an error for me using Fish on Fedora. I’ve resolved this by updating Fish paths:
1
set -Ux fish_user_paths /home/aaron/bin $fish_user_paths
I’ve cloned the Chirpy Starter locally, where I can run a local development server so I can preview the site locally:
1
2
3
4
5
6
git clone https://github.com/cotes2020/chirpy-starter.git
cd chirpy starter
bundle install
# preview the site
bundle exec jekyll serve
The source files are maintained in a source repository in Codeberg.
Deployment
Deploying the site involves publish the built assets to a remote pages
repository in Codeberg.
We can build the Chirpy site using jekyll build
, which will generate a new _site
directory containing the built site.
1
$ JEKYLL_ENV=production bundle exec jekyll b
I’ve then set up the _site
directory as a Git submodule and set the remote pages
repo in Codeberg. This means that any time the site is built from source, I have a convenient way to publish changes to the live site, by committing and pushing changes to the pages
repository/submodule.
Note, that to get this playing nicely, we declare this submodule in the pages-src
repository:
1
2
3
4
# .gitmodules
[submodule "_site"]
path = _site
url = https://codeberg.org/aaronmarr/pages
I’m quite happy with this modest setup for now. It’s a bit of a departure from a full-blown CI/CD setup which I would normally use in a professional setting. However, the setup I’m using here uses far fewer resources to publish each build, and so scratches a personal itch for ensuring this website is as sustainable as possible.
Codeberg does have its own CI/CD solution based on Woodpecker CI, which I may investigate in future. But for now I’m happy taking this lightweight approach.