NARRATOR: Automation is key for streamlining your work processes
and GitHub Actions is the best way to supercharge your GitHub Workflow.
This enables you to create
custom software development life cycle workflows directly in your GitHub repository.
GitHub Actions is fully integrated into GitHub.
It's built-in from the merge box to the checks tab,
from the UI to the API.
It works the way that GitHub works.
Since GitHub Actions help you automate your software development workflows in
the same place you store code and collaborate on pull requests and issues,
you can discover, create,
and share actions to perform essentially any job that you'd like,
including CI and CD,
and then combine actions in a completely customized workflow.
To visualize how this can be useful,
let's take a quick look at the basic GitHub Flow,
a lightweight yet effective branch-based workflow commonly used on GitHub,
and then see how GitHub Actions fits in.
Now, when we want to make changes to our code in our GitHub Repository,
we branch off of main or the production branch, maker commits,
open up a pull request on GitHub to share our changes,
and then merge this branch into the main branch and then delete our feature branch.
Looking at the GitHub Flow,
where would this automation with GitHub Actions take place?
Well, the great thing about GitHub Actions is that you can apply
existing GitHub Actions or even create
your own GitHub Actions to essentially any stage in the GitHub Flow.
Do you want to include CICD?
Well, GitHub Actions can do that.
Do you want a specific automated tasks to run
when an issue is opened, labeled, or closed?
How about when a pull request is opened and you want automated reminders
created based on labels or reviewers from a code owners file?
Well, GitHub Actions enables you to create
these custom software development life cycle workflows
directly in your GitHub repository.
GitHub Actions are event-driven,
meaning that you can run a series of commands after a specified event has occurred.
For example, every time someone creates a pull request for a repository,
you can automatically run a command that executes a software testing script.
Instead of using CI or CD integrations, with GitHub Actions,
you can build end-to-end CI and CD capabilities,
and yes, you probably guessed it,
directly in your GitHub Repository.
This gives you the ultimate freedom to customize how your actions
work and automate tasks all along your software development life cycle.
Now that we can see where we can apply automation
using GitHub Actions within our software development workflow,
let's take a closer look into how GitHub Actions actually work.
GitHub Actions use YAML syntax to define the events, jobs, and steps.
These YAML files are stored in
your code repository in a directory called .github/workflows.
An event automatically triggers the workflow which contains a job.
The job then uses steps to control the order in which actions are run.
These actions are the commands that automate your software testing.
In this example workflow,
it automatically triggers a series of commands whenever code is pushed.
GitHub Actions checks out the pushed code, installs the software dependencies,
and runs bats-v to output the software version.
With GitHub Actions, you can also build, test,
and publish across multiple operating systems,
platforms, and languages all within the same workflow,
and then see the status checks displayed within your pull request.
With GitHub Actions,
you have the ability to create your own actions or leverage
these pre-built actions by the community found on the GitHub marketplace.
So if you've been itching to customize and automate your workflow from idea to production,
jump into GitHub Actions today and explore
the amazing community actions in the GitHub marketplace