Posted on • Originally published atbahaanoah.com on
Launching an Engineering Blog
Launching a personal engineering blog has always been one of my career goals, which I had put off for a long time before finally achieving. There has been always a push back when it comes to choosing tech stack for building it, I never been a big fan of CMS solutions likewordpress and other similar CMS, there is nothing wrong with it, it's just a personal preference. The other option was to build it myself using any of the languages I am familiar with like PHP or Java but that was an over kill and too much for just a blog.
I got inspired to start when I came across a blog post fromZalando Engineering on linkedin about how they launched there engineering blog and that was the triggering point for me, you can read more about it hereLaunching the Engineering Blog.
In this post, I'll take you through how I built my blog using static site generator and automating publishing and deployment on AWS S3 using Github Actions.
Choosing Static Site Generator
Jamstack provides a wide range of static site generators. They are all pretty much having similar functionalities to render a website from Markdown.
I decided to choosejigsaw as I am familiar with the technologies it's built with (PHP ,Tailwind for styling andBlade as template engine) as it will be easy to customize if needed besides that, it comes with decent amount of features out of the box, I barely did any customization to it, just followed theinstallation instructions and got started.
After installation and customizing it, I wanted to setup the infrastructure where it will be hosted. I wrote another blog post on how I used Terraform to build static website infrastructure on AWS, read more about ithere.
Writing and Publishing
As it's an engineering blog writing markdown is pretty much familiar to most of software engineers given the fact we have to write markdown documentation all the time.
After writing, I wanted to automate deployment and publishing. I am using Github as a repository and I have experience withCircleCi but I wanted to learnGithub Actions. I decided to take this opportunity to learnGithub Actions instead ofCircleCi.
here's how I automated the deployment
- Create anIAM user on AWS with S3 full access permission and save the access key and secret for later.
- In Github in your repository setting under security section, click on Actions option and create two new repository secrets from the keys you have from the previous step
AWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
.
- Finally create an action workflow that will trigger once merged on the main branch.
name: Mainon: push: branches: ["master"]jobs: build: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 - name: Install Composer Dependencies run: composer install - name: Install Npm run: npm install - name: Run Npm prod run: npm run prod - name: Build Jigsaw site run: ./vendor/bin/jigsaw build production - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 with: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: ap-south-1 // change that to the region you are using - name: deploy run: aws s3 sync build_production/. s3://bahaanoah.com/ --region ap-south-1 --delete
And there you have it a functional blog with automated CI/CD.
Tracking
Eventually I wanted to get some insights on blog views without invading visitors privacy and being GDPR compliance without Cookie banners. I found some great options likeplausible andgetinsights and decided to go forgetinsights because they have a free tier and I am not really expecting heavy traffic at the beginning.
Conclusion
I do strongly believe one of the best ways to learn is by teaching and that has been one of the main reasons I started blogging, besides that I am passionate about sharing knowledge and simplifying complex subjects.
I hope this was helpful and will inspire you to start your own blog and start writing as well. It can be also a good use as an engineering blog for your company that provides a good platform for engineers to publish their thoughts and share the engineering culture there.
Thanks for reading, I hope this was helpful. Please feel free toreach out if you need more help or have any suggestions.
Top comments(0)
For further actions, you may consider blocking this person and/orreporting abuse