paint-brush
Beginner’s Explanatory Guide to GitHub Actionsby@epmnzava
129 reads

Beginner’s Explanatory Guide to GitHub Actions

by epmnzavaJanuary 20th, 2022
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

GitHub Actions is a free service which can run on a repo when configured. It is similar to CircleCI, which is a CI/CD platform that lets teams build and deliver great software, quickly and at scale, at scale. Using GitHub Actions takes out the pain of manually running commands on your machine and moves it to the cloud to automated runners. You can see a history of runs for a single job here in my Laravel bill-me package repo. I will soon publish an article showing how you can use Github actions to both run tests and deploy your web application and or package.

Company Mentioned

Mention Thumbnail

Coin Mentioned

Mention Thumbnail
featured image - Beginner’s Explanatory Guide to GitHub Actions
epmnzava HackerNoon profile picture

So what are GitHub Actions?

Github Actions is a free service that can run on a repo when configured. It is similar to CircleCI which is a CI/CD platform that lets teams build and deliver great software, quickly and at scale, in the cloud, or on your own infrastructure.

What Can You Do With GitHub Actions?

Run shell commands against our repo code (usually Bash on Ubuntu)Use Github’s cloud infrastructureTrigger on an event, like a commit, a Pull Request ( PR), or on a schedule, even on a manual button press now.

Importance of GitHub Actions

Github Actions takes out the pain of manually running commands on your machine and moves it to the cloud to automated runners.

You don’t have to touch your terminal but you’ll get a log of steps that is centralized and public — nice to share across your team or open-source contributors.

The job runs each pass and fails status and the corresponding commit — so you can track down a bug by seeing the first time your job switched from passing to failing state.

You might use Github Actions to build and deploy your package or website, but only if all the safety checks you’ve set up are met. This builds confidence in getting a quality product delivered.

Common Terms

Workflow

Your actions config is a “workflow” of triggers and steps.

These steps can be a mixture of:

shell commands (like pip install … or npm run build)external actions

A workflow file is stored here as a YAML file: .github/workflows/main.yml.

Job

A workflow is the config file.

The job is what actually executes.

You can see a history of runs for a single job.

You can see runs for the “ CI-CD” job here in my Laravel bill-me package repo.

Action

You can find an action available in the Actions “marketplace” but really it is a repo that is published by the community and accepted by Github if it meets standards.

An action is a packaged, reusable flow which you can use as a library or module. Use it to do more complex tasks in your workflow without writing the code yourself.

Note that you don’t have to use an action. You can build and test a Laravel app or package using just plain commands as steps.

But if you want more advanced functionality, action is great:

Installing and building against using multiple versions of your runtime. Building a Jekyll site or Laravel web app to a GitHub Pages branch to serve on Github Pages like this one.

In My Opinion

I have enjoyed using GitHub actions as it has let me automate most of my tasks such as running tests and deploying various applications on the server as soon as I push my code to GitHub.

Are you a Laravel developer? I will soon publish an article that will show you how you can use Github actions to both run tests and deploy your web application and or package.

Before you go… Thanks for reading the article! If you enjoyed it, please don’t forget to show your appreciation by clicking 👏 below!

Any questions or comments hit me up:

Mail: [email protected]

Twitter: https://twitter.com/epmnzava

Github: https://github.com/dbrax