placeholder text

DevOps: Two Environments for Small Projects


Part 3 of the DevOps for Non-DevOps Engineers series

Introduction

Smaller projects and static sites won’t always need a proper devOps implementation. Usually, a single Git branch with an automatic deployment integration will suffice, though, there are some situations where a simple two-environment implementations will come in handy. Even as a student, or if you only do small personal projects: if you find yourself needing more and you have the time, it doesn’t hurt to be thorough and consistent . Setting up devOps on your smaller projects can also give you exposure to, and some familiarity with, other areas of software development that you don’t deal with everyday; which can help you stay well rounded and ready to participate effectively in cross functional work scenarios.

This quick guide will go over a basic devOps implementation using GitHub Actions and Workflows to protect branches and to enforce pull request rules, as well as Netlify integrations for auto-deployment, applied to a static blog site.

What is the motivation for this article? In my current job role I set up and assign work tasks related to complex devOps implementations, but almost always according to templates and SOPs for our organization. I was also doing some side work on a small static blog site and I needed to test an integration with an element that was difficult to style; at first the element wouldn’t render during runtime and I had to adjust my dev environment, then I still couldn’t test on extra-small screens since Google Chrome on MacOS has a minimum view width of 500px, the solution was to set up a dev environment deploy so that I could just view the work on my phone without deploying to prodcution.

The static site in my scenario was not a high traffic site. Very few people, if any, would have visited that site while I was trying to style this element and I could have just dealt with the imperfect production deploy. That’s not always the case though, and this devOps implementation would offer a more professional approach to updating a busier static site with more traffic.

Conclusion

Resources

A good example of a .github/ directory

https://github.com/github/docs/tree/main/.github

Contains:

  • list of actions
  • list of workflows
  • branch_protection_settings
  • pull request templates

Repository Settings

Settings -> Actions -> General -> Workflow Permissions -> read and write