GitHub Actions

Before we get too far, lets talk about what Github Actions are, how they work and how this course is put together.


GitHub Actions

Actions make it easier to automate your projects. You can automatet tasks your repositories either on a timer or when an event happens, like for example when someone pushes to a branch or opens a pull request.

You can create your own actions or use actions created by the community, which you can find in the GitHub Marketplace.

In this course, I'm going to show you how to build actions locally and then publish them to the GitHub Marketplace.


Prerequisites

  • Advanced Course
  • Git and GitHub
  • Command Line
  • Programming Experience

This isn't a beginner course, as a matter of fact, it's categorized as an advanced course.

I'm assuming that you know how to work with Git and GitHub.If you're new to GitHub, you might want to check out some of the other courses on the site.

I'm also assuming that you're familiar with the command line, and that you have experience programming with something like python.

This is very much a hands-on course and I'm going to be showing you how to do things. You should definitely try to follow along and I'm hoping that you'll think of how you can build your own custom actions and add them to the marketplace.


What We're Doing

Probably the best piece of advice I can give you when you're trying to learn something is to solve a problem that you're having.

So In this course, we're going to be building something I needed for my own work. I recentely launched a podcast and I wanted to create a feed that I could use.

A podcast feed is a way for podcast apps to find out information about your show and episodes. From a technical standpoint i'ts an XML file in a specific format called RSS.

XML is a markup language like HTML, but it's used for different kinds of information.

RSS is a flavor of XML specifically for syndicating content. Used for news and podcast content.

If you take a look at this sample feed, you can see that it's not particularly fun to write manually.

So, instead, I'm going to use the YAML format to write the information about my podcast, and use a GitHub Actions to generate the feed.


Building Actions

There are plenty of services that you can use to easily host your podcast feed, but for GitHub is a great and free solution for this problem.

GitHub Pages allows you to host static websites for free. You can use it to host your podcast feed.

To parse the YAML into XML, we're going to be using python. Python is a great language for processing data. It's super fast, easy to use and has a ton of libraries that can help you with your needs. I'm assuming you have python installed on your machine. It you need help doing that, check out this course.

Because we're going to be publishing this in the marketplace, we're going to need to write out a Dockerfile. GitHub Actions can use this to build a container that will run our action. Think of a container as a virtual machine that's running in the cloud.

We're also going to need to run some bash scripts to run our python file and also to make sure that our changes are pushed back to GitHub.


The Code

  • Repo Files
  • Your Own Repository
  • Custom Workflows, Dockerfiles, etc.

Normally, when I'm building projects, there's a repository for each course and you can use that to follow along with the class. That's not going to work with this course.

I created a repository at this URL as usual, but you will be building this project on your own repository. The LinkedIn repo will have some sample content as well as the code for the scripts, but you're not going to be able to use it to follow along.

You're going to be building your own Actions, Workflows, Dockerfiles, and customizing things that would break the repository if you used it.

Alright, that's enough talk. Let's build this.