Enable or disable maintenance mode for a service
The action relies on make commands defined in the new_service template.
Federated credentials must be set up to allow the action to authenticate to Azure and kubernetes
environment
: Name of the app environment affected (Required)azure-credentials
: A JSON string containing service principal credentials e.g. {“client_id”: “x”, “client_secret”: “x”, “subscription_id”: “x”, “tenant_id”: “x”}azure-client-id
: Azure service principal or managed identity client ID when using OIDCazure-subscription-id
: Azure service principal or managed identity subscription ID when using OIDCazure-tenant-id
: Azure service principal or managed identity tenant ID when using OIDCmode
: Mode to set, either enable or disable (Required)docker-repository
: full name of the docker repository for the maintenance image (Required)github-token
: github token that can push the maintenance image to the docker repository (Required)on:
workflow_dispatch:
inputs:
environment:
required: true
type: choice
options:
- staging
- production
mode:
required: true
type: choice
options:
- enable
- disable
jobs:
set-maintenance-mode:
name: Set maintenance mode
runs-on: ubuntu-latest
environment: $
permissions:
id-token: write # Required for OIDC authentication to Azure
...
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Enable or disable maintenance mode
uses: DFE-Digital/github-actions/maintenance@master
with:
azure-client-id: $
azure-subscription-id: $
azure-tenant-id: $
environment: $
mode: $
docker-repository: ghcr.io/dfe-digital/some-service-maintenance
github-token: $