github-actions

Maintenance mode

Enable or disable maintenance mode for a service

The action relies on make commands defined in the new_service template.

OIDC

Federated credentials must be set up to allow the action to authenticate to Azure and kubernetes

Inputs

Example

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: $