
GitHub Copilot Chat beta now available for all individuals
All GitHub Copilot for Individuals users now have access to GitHub Copilot Chat beta, bringing natural language-powered coding to every developer in all languages.
CI/CD and workflow automation are native capabilities on GitHub platform. Here’s how to start using them and speed up your workflows.
The first time I saw a CI/CD pipeline in action was a real wake-up moment. I was working at a company that used GitHub Actions to cut its release times down to five minutes. And if any issues cropped up, you could roll back a release with the touch of a button.
At that time, I had just finished a stint at a startup where the release process was far more manual and far more anxiety-inducing. We were a small team and without the benefit of a CI/CD pipeline or blue-green deployments, we could only release updates when users were less likely to be on our app late at night. It was a tedious process where any degree of human error would stretch out how long it took to deploy a build.
Yet that first experience with CI/CD turned a buzzword into something tangible and impressive, fueled by automated workflows running on GitHub Actions. Now, in a funny twist, I’m working at GitHub where GitHub Actions has become a personal focus area.
So, for anyone just getting started with CI/CD and workflow automation on GitHub, I want to turn my experience of being introduced to GitHub Actions into a resource.
Let’s get started.
For the uninitiated or anyone who’s heard of it but doesn’t fully understand it, GitHub Actions is a native CI/CD tool that runs alongside your code in GitHub. In fact, you may have noticed a tab that says “Actions” in a GitHub repository at some point (hint: that’s where GitHub Actions lives).
A screenshot showing the GitHub Actions tab in a repository
Once you open this tab up for the first time, you’ll find a quick description of what GitHub Actions is and some suggested workflows for your repository. That’s where the fun starts. GitHub Actions comes with more than 13,000 pre-written and tested CI/CD workflows and pre-built automations in the GitHub Marketplace, as well as the ability to write your own workflows (or customize an existing workflow) in easy-to-use YAML files.
A screenshot of the introduction screen a developer will see the first time they open GitHub Actions in a repository
I’ll walk you through how to build your own GitHub Actions workflow later on, but I’ll leave you with this for now: A GitHub Actions workflow can be designed to respond to any webhook event on GitHub. That means you can turn any webhook on GitHub into a trigger for an automation within your CI/CD pipeline—and that includes third-party webhook events too.
So, we’ve talked a bit about a GitHub Actions workflow—but sometimes it’s easiest to just see one in action (pun intended):
A screenshot of an example GitHub Actions workflow
The above workflow is composed of a few different things. These include:
When you put all of these concepts together, you get a workflow that might look something like this:
on:
issues:
types: [opened]
jobs:
comment:
runs-on: ubuntu-latest
steps:
- name: Rick Roll
uses: TejasvOnly/random-rickroll@v1.0
with:
percentage: 100
(For reference, this is a fun GitHub Actions workflow you theoretically could make part of your CI/CD pipeline. It posts a GIF of Rick Astley as a comment on every new issue that’s opened in a repository, which is scientifically proven to bolster your productivity and general enjoyment. I promise.)
In my experience, there are four common ways I use GitHub Actions (and don’t worry, I’m including links to pre-built workflows that you can drop into your repository and start using right away). These include:
At this point, it shouldn’t surprise you to hear that a powerful and common use case for GitHub Actions revolves around CI/CD.
It’s far from the only CI/CD platform out there (and you can integrate just about any CI/CD platform into your GitHub workflow), but it’s benefits stem from its close integration with the rest of the GitHub platform—and the ability to trigger any part of a CI/CD pipeline off of any webhook on GitHub.
Here are some useful, pre-built GitHub Actions CI/CD workflows you can use to get started:
Release management is a critical part of a CI/CD pipeline. Yet you can also automate your releases even without a fully baked CI/CD pipeline. Whichever path you choose, here are two really helpful GitHub Actions workflows to level-up your approach to release management:
Whether we’re talking about part of your CI/CD pipeline or part of your normal workflow, there’s a good chance you’re using more than one tool when you’re building code. Making sure all those tools integrate with one another can be one of the less fun parts of development work—but it’s an important step.
Here are two types of workflows that I find exceptionally helpful for any beginner:
As I’ve spoken with open source maintainers and people at companies, I’ve heard time and again how time consuming maintaining an active project, team, and/or community can be. In addition to CI/CD, GitHub Actions is a great tool for automating repeatable, yet often manual tasks within an organization, as well as managing projects and teams at scale.
In that vein, here are a few useful GitHub Actions workflows that I’ve come across:
Just in case the above workflows aren’t enough to keep you busy, I wanted to give you a few more. In our Starter Workflows repository, you can find a bunch of pre-built GitHub Actions that are ready to use for continuous integration, continuous deployment, code scanning, and workflow automation. Every one of these workflows has been built and tested by the GitHub team—and they’re updated regularly too.
One of my personal favorites is CodeQL, which brings GitHub’s static code analysis engine into your workflow to identify any known security vulnerabilities in your code. Also, there are plenty of other pre-built workflows for any number of things you may be working on.
Since there are more than 13,000 GitHub Actions in the GitHub Marketplace, there’s a good chance you won’t need to create a workflow from scratch, since one probably already exists. Yet there probably will be a few times where you find a workflow that’s almost perfect, but needs a slight tweak to fit your needs perfectly.
In this situation, you can either create a new workflow or customize a pre-built workflow. And if you’re wondering how to customize a workflow, try reading this article I put together.
Find out how to customize a pre-built GitHub Actions workflow
Sometimes it’s easier to learn by watching someone else do something in real-time. So, if you’re trying to build your own GitHub Actions workflow, watch this video to learn how to build your own action in less than 10 minutes.