You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: learn-pr/github/create-custom-github-actions/includes/create-custom-github-action.md
+29-2Lines changed: 29 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -432,9 +432,36 @@ Docker container actions are powerful for encapsulating complex tools and enviro
432
432
## Understand the Docker action lifecycle
433
433
434
434
Before troubleshooting, it's helpful to understand how Docker container actions run.
435
-
:::image type="content" source="github-docker-workflow-blue.png" alt-text="Diagram showing how Docker container actions run in a GitHub Actions workflow." border="false":::
436
435
437
-
Note: Docker container actions run in a clean, isolated environment. File system state, installed tools, and environment variables must all be defined within the Dockerfile.
436
+
### 1. Workflow Trigger
437
+
438
+
A GitHub Actions workflow starts in response to a configured event—such as a `push`, `pull_request`, or manual `workflow_dispatch`.
439
+
440
+
### 2. Runner Setup
441
+
442
+
GitHub provisions a fresh virtual machine (the **runner**) to execute the workflow. The runner prepares the environment by downloading action definitions and resolving dependencies.
443
+
444
+
### 3. Action Resolution
445
+
446
+
If the action specifies `runs.using: docker` in its `action.yml` file, GitHub recognizes it as a Docker-based action.
447
+
448
+
### 4. Image Build or Pull
449
+
450
+
GitHub builds the Docker image defined in the action’s `Dockerfile` or pulls a prebuilt image if specified. This image defines the environment in which the action code runs.
451
+
452
+
### 5. Container Execution
453
+
454
+
The runner launches the Docker container, mounts the workspace, and injects environment variables, including secrets and inputs defined in the workflow.
455
+
456
+
### 6. Entrypoint Runs
457
+
458
+
GitHub executes the `entrypoint` command from the Dockerfile inside the container. This is where the custom action logic runs, typically a script or application.
459
+
460
+
### 7. Result Handling
461
+
462
+
Any outputs set by the container action are captured by the runner and passed along to subsequent steps in the workflow. Once complete, the container shuts down and the runner is discarded.
463
+
464
+
> Note: Docker container actions run in a clean, isolated environment. File system state, installed tools, and environment variables must all be defined within the Dockerfile.
0 commit comments