Skip to content

GitHub Actions

GitHub Actions is CI/CD platform built into GitHub. We can utilize GitHub Actions to perform automated tasks like project deployment, perform automatic update, run code security audit.

INFO

GitHub Actions is included in Free Tier of GitHub with limitation of 2,000 run minutes per month per user.

GitHub Actions are stored inside .github in root directory of the project. it consists mainly of two parts: action and workflow

Action

Action is a reusable task or command that can be used (and reuse) inside workflows. You can think of it as a function that can be used across the project or even multiple projects.

Workflow

Workflow dictate the entire process. You can think of it as a whole program. Workflows must be stored inside .github/workflows directory. Workflow also include the detail on when or what to trigger the workflow

For example, We are going to create automatic deployment process with these steps

  1. Checkout latest code from repository
  2. Compile and optimize assets
  3. Deploy the code with compiled assets onto server.

From the example, We could create an action for each step. Then we create a workflow that will be triggered when developer commited anything into develop branch. Inside the workflow we will call to each action.

More detail on GitHub Actions