Run github action locally
GitHub Actions help automate tasks like building, testing, and deploying in your GitHub repository.
With act CLI tool we can write and test the GitHub action locally.
config github action
- Add
.github/workflowsfolder to project root - Add yaml file and declare jobs
view
from project root
example
Run job on local docker
| arg | desc |
|---|---|
| -j | job to run for workflow |
| -P | custom image to |
| --pull | pull image from hub or find it locally |
Workflow
| arg | desc |
|---|---|
| name | workflow name |
| on | running trigger event [push, pull_request, workflow_dispatch] |
| jobs | workflow jobs |
| runs-on | platform to run on (image name declare in act command ) |