Skip to content

Commit b541e0d

Browse files
authored
Update create-custom-github-action.md
1 parent 09b41b0 commit b541e0d

File tree

1 file changed

+29
-2
lines changed

1 file changed

+29
-2
lines changed

learn-pr/github/create-custom-github-actions/includes/create-custom-github-action.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,9 +432,36 @@ Docker container actions are powerful for encapsulating complex tools and enviro
432432
## Understand the Docker action lifecycle
433433

434434
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":::
436435

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.
438465
439466
### Debugging techniques
440467
#### 1. Add Logging

0 commit comments

Comments
 (0)