Skip to content

Maintenance mode set to enabled on staging by @placek #14

Maintenance mode set to enabled on staging by @placek

Maintenance mode set to enabled on staging by @placek #14

name: Toggle maintenance page
run-name: Maintenance mode set to ${{ inputs.maintenance }} on ${{ inputs.environment }} by @${{ github.actor }}
on:
workflow_dispatch:
inputs:
environment:
required: true
type: choice
default: "dev"
options:
- "dev"
- "test"
- "staging"
- "beta"
maintenance:
required: true
type: choice
default: "enabled"
options:
- "enabled"
- "disabled"
env:
ENVIRONMENT: ${{ inputs.environment || 'dev' }}
CARDANO_NETWORK: "sanchonet"
jobs:
toggle_maintenance:
name: Toggl maintenance state
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./scripts/govtool
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v3
with:
aws-access-key-id: ${{ secrets.GHA_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.GHA_AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1
- name: Login to AWS ECR
uses: aws-actions/configure-aws-credentials@v2
with:
aws-region: eu-west-1
- name: Setup SSH agent
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.GHA_SSH_PRIVATE_KEY }}
- name: Set domain
run: |
if [[ "${{ inputs.environment }}" == "staging" ]]; then
echo "DOMAIN=staging.govtool.byron.network" >> $GITHUB_ENV
elif [[ "${{ inputs.environment }}" == "beta" ]]; then
echo "DOMAIN=sanchogov.tools" >> $GITHUB_ENV
else
echo "DOMAIN=${DOMAIN:-$ENVIRONMENT-$CARDANO_NETWORK.govtool.byron.network}" >> $GITHUB_ENV
fi
- name: Toggle maintenance
run: |
make toggle-maintenance maintenance=${{ inputs.maintenance || 'disabled' }}