GitHub Actions: Build Your First Workflow

Rizèl Scarlett - Nov 8 '21 - - Dev Community

Github Actions: What is it?

GitHub Actions is a tool that conveniently enables you to automate custom workflows inside of your GitHub repository. There is a marketplace filled with already-made actions created by developers around the world that you can use. However, if you’re not able to find an Action for your use-case, you can create your own. And if you want to, feel free to share it on GitHub Marketplace to improve the lives of other developers.

What is a workflow?

In the above paragraph, I mentioned that GitHub Actions allows you to automate custom workflows, but what is a workflow? A workflow is a configurable, automated process. Each workflow is written in a YAML (Yet Another Markup Language) file using YAML syntax. All workflows can be triggered by events that happen within or to your repository. Examples of events that happen within your repository include: a push or pull request.

Actions vs. Workflow: What's the difference?

The definitions seem pretty similar, so what is the difference?

The answer is that you can use an action IN a workflow!

Actions are standalone commands that are combined into steps to create a job. Actions are the smallest portable building block of a workflow. You can create your own actions, or use actions created by the GitHub community. To use an action in a workflow, you must include it as a step.

Useful Actions

Developers often find themselves doing tedious tasks that take away from their productivity. Here are some actions I've used in the past that helped me immensely:

How do I create my first workflow?

To write your own workflow for GitHub Actions, create a directory at the root of your project called .github/workflows/. Inside the directory is where you will store your workflows. Each workflow file should end with the extension .yml indicating that it's written using YAML syntax.

Follow GitHub's written tutorial to build your very first action in 5 minutes.

If you want to learn more, you can read about my personal experience setting up a workflow to sync a directory to an AWS S3 bucket.

Join the GitHub Actions Hackathon

From now until December 8th, GitHub is running a Hackathon. By participating, you have the chance to win gift cards and swag. The challenge is to create and submit a workflow leveraging already existing actions. GitHub Marketplace currently has over 10,000 actions.

Read here to learn more about participating in the hackathon.

And if you need any help regarding actions, I'll be available to answer questions in this thread.

Comment below and tell me some of your favorite actions! I'm curious!

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .