github-actions-0.1.1.0: Github Actions
Copyright(c) 2025 Bellroy Pty Ltd
LicenseBSD-3-Clause
MaintainerBellroy Tech Team <haskell@bellroy.com>
Safe HaskellNone
LanguageHaskell2010

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

Synopsis

Documentation

data Service Source #

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

Instances details
FromJSON Service Source # 
Instance details

Defined in Language.Github.Actions.Service

ToJSON Service Source # 
Instance details

Defined in Language.Github.Actions.Service

Generic Service Source # 
Instance details

Defined in Language.Github.Actions.Service

Associated Types

type Rep Service 
Instance details

Defined in Language.Github.Actions.Service

Methods

from :: Service -> Rep Service x #

to :: Rep Service x -> Service #

Show Service Source # 
Instance details

Defined in Language.Github.Actions.Service

Eq Service Source # 
Instance details

Defined in Language.Github.Actions.Service

Methods

(==) :: Service -> Service -> Bool #

(/=) :: Service -> Service -> Bool #

Ord Service Source # 
Instance details

Defined in Language.Github.Actions.Service

type Rep Service Source # 
Instance details

Defined in Language.Github.Actions.Service

new :: Service Source #

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"]
  }