| 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.Service
Description
This module provides the Service type for defining service containers that run
alongside job steps in GitHub Actions workflows.
Service containers are Docker containers that provide services like databases, message queues, or other dependencies that your job steps might need during execution. They run in parallel with your job and are accessible via hostname.
For more information about GitHub Actions service containers, see: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_idservices
Documentation
A service container definition for GitHub Actions jobs.
Service containers run Docker images that provide services your job steps can use. Common examples include databases, caches, and message queues.
Service containers are automatically started before job steps run and stopped after the job completes. They can be accessed by job steps using their service ID as hostname.
Example usage:
import Language.Github.Actions.Service
import qualified Data.Map as Map
-- PostgreSQL database service
postgresService :: Service
postgresService = new
{ image = Just "postgres:13"
, env = Just $ Map.fromList
[ (POSTGRES_PASSWORD, "postgres")
, (POSTGRES_DB, "testdb")
]
, ports = Just ["5432:5432"]
}
-- Redis cache service
redisService :: Service
redisService = new
{ image = Just "redis:6-alpine"
, ports = Just ["6379:6379"]
}
For more details, see: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_idservices
Constructors
| Service | |
Fields
| |
Instances
Create a new empty Service with default values.
This provides a minimal service definition that can be extended with specific image, ports, environment variables, and other configuration.
Example:
databaseService = new
{ image = Just "postgres:13"
, env = Just $ Map.singleton POSTGRES_PASSWORD "secret"
, ports = Just ["5432:5432"]
}