Skip to content

jellydn/github-action-locally

Repository files navigation

Welcome to github-action-locally 👋

How to run GitHub Action locally with act.

IT Man - Running GitHub Actions Locally: A Complete Guide with act [Vietnamese]

Sources

Prerequisites

  • Docker or a compatible container engine (e.g., OrbStack, Podman)
  • act installed. You can install it via Homebrew:
    brew install act

Usages

Clone your repository to your local machine:

gh repo clone jellydn/github-action-locally

Then run

bun install

Basic Usage

Run all GitHub Action workflows defined in your .github/workflows/ folder:

act

List all jobs

act -l

Running a Specific Job

Run a specific job from your workflow file:

act -j <job-name>

Using a Custom Runner

Specify a custom Docker image for the runner:

act -P <platform>=<docker-image>

Example:

act -P ubuntu-18.04=nektos/act-environments-ubuntu:18.04

Using a Different Container Engine

If you prefer to use Podman:

export DOCKER_HOST='unix:///var/run/podman/podman.sock'
act

Or, with a remote Docker engine:

DOCKER_HOST='ssh://user@host' act

Even though if you don't know where is the Docker socket, you can use the following:

docker context ls --format json | jq

Then you would have similar output:

{
  "Current": false,
  "Description": "Current DOCKER_HOST based configuration",
  "DockerEndpoint": "unix:///var/run/docker.sock",
  "Error": "",
  "Name": "default"
}
{
  "Current": true,
  "Description": "OrbStack",
  "DockerEndpoint": "unix:///Users/huynhdung/.orbstack/run/docker.sock",
  "Error": "",
  "Name": "orbstack"
}

Troubleshooting

If you encounter issues, please refer to the official act User Guide or open an issue in this repository.

References

IT Man - Talk #34 - Bye Bye #Docker Desktop [Vietnamese]

Author

👤 Huynh Duc Dung @jellydn

Show your support

Give a ⭐️ if this project helped you!

About

How to run GitHub Action locally with act.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published