| Copyright | (c) 2025 Bellroy Pty Ltd |
|---|---|
| License | BSD-3-Clause |
| Maintainer | Bellroy Tech Team <haskell@bellroy.com> |
| Safe Haskell | None |
| Language | Haskell2010 |
Language.Github.Actions.Job.Container
Description
This module provides the JobContainer type for configuring Docker containers
that jobs run inside of in GitHub Actions workflows.
Job containers allow you to run job steps inside a Docker container with a specific environment, dependencies, and configuration. This provides consistency across different runner environments and enables the use of custom tooling.
For more information about GitHub Actions job containers, see: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_idcontainer
Documentation
data JobContainer Source #
Container configuration for running a job inside a Docker container.
Job containers provide an isolated, consistent environment for job execution. This is useful for ensuring specific tool versions, operating system environments, or complex dependency setups.
Example usage:
import Language.Github.Actions.Job.Container
import qualified Data.Map as Map
-- Node.js development container
nodeContainer :: JobContainer
nodeContainer = JobContainer
{ image = Just "node:18"
, env = Just $ Map.fromList [(NODE_ENV, "test")]
, credentials = Nothing
, options = Nothing
, ports = Nothing
, volumes = Nothing
}
-- Database testing container with services
dbTestContainer :: JobContainer
dbTestContainer = JobContainer
{ image = Just "ubuntu:22.04"
, env = Just $ Map.fromList [(DEBIAN_FRONTEND, "noninteractive")]
, credentials = Nothing
, options = Just "--network postgres"
, ports = Just ["8080:8080"]
, volumes = Just ["${{ github.workspace }}:/workspace"]
}
For more details, see: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_idcontainer
Constructors
| JobContainer | |
Fields
| |
Instances
gen :: MonadGen m => m JobContainer Source #