Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ti-infinite/GSMInfrastructure/llms.txt

Use this file to discover all available pages before exploring further.

GSM Infrastructure uses two GitHub Actions workflows — deploy-infrastructure.yml and deploy-scheduler.yml — to deploy CloudFormation stacks automatically whenever the corresponding template files change on a tracked branch. Each branch maps to a fixed AWS environment (dev, qa, or prod), so merging a pull request from develop into quality or quality into main triggers the correct environment deploy without any manual configuration. Authentication to AWS is handled through OpenID Connect (OIDC), meaning no static AWS access keys are stored in GitHub Secrets.

Branch-to-environment mapping

BranchEnvironmentStack name pattern
developdevdev-{appName}-*-stack
qualityqaqa-{appName}-*-stack
mainprodprod-{appName}-*-stack
The stack name is assembled at runtime from the resolved environment and the APP_NAME GitHub Actions variable, for example dev-gsmapplication-infrastructure-stack.

deploy-infrastructure.yml

The infrastructure workflow deploys devops/infrastructure/template.yml to provision the S3, CloudFront, ECR, ECS, EC2, IAM, SNS, and AWS Budget resources described in the infrastructure stack guide. Triggers:
  • Push to develop, quality, or main when devops/infrastructure/template.yml has changed.
  • workflow_dispatch with an environment input (dev / qa / prod) for on-demand deploys.
Jobs:
Runs first. Reads github.ref_name (branch name) and maps it to the target environment string, or uses the workflow_dispatch input if the trigger was manual. The resolved environment is passed as a job output to the deploy job.
determine-env:
  if: ${{ vars.WORKFLOW_INFRASTRUCTURE_ENABLED == 'true' }}
  name: Determine Environment
  runs-on: ubuntu-latest
  outputs:
    environment: ${{ steps.set-env.outputs.environment }}

deploy-scheduler.yml

The scheduler workflow deploys devops/scheduler/template.yml to provision the EventBridge Scheduler rules and Lambda functions described in the scheduler stack guide. Its structure is identical to the infrastructure workflow but is independently controlled by the WORKFLOW_SCHEDULER_ENABLED variable. Triggers:
  • Push to develop, quality, or main when devops/scheduler/template.yml has changed.
  • workflow_dispatch with an environment input.
Jobs: Same two-job pattern (determine-envdeploy) as the infrastructure workflow. The CloudFormation stack name follows the pattern {env}-{appName}-scheduler-stack. All scheduler-specific parameters (EC2InstanceId, EIPAllocationId, ECSClusterName, service names, cron expressions) are sourced from GitHub Actions variables.

OIDC authentication flow

Neither workflow stores a static AWS_ACCESS_KEY_ID or AWS_SECRET_ACCESS_KEY. Instead, they use the aws-actions/configure-aws-credentials@v4 action with an id-token: write permission to obtain short-lived credentials via AWS STS:
  1. GitHub generates a signed OIDC token for the workflow run.
  2. configure-aws-credentials presents the token to the AWS STS AssumeRoleWithWebIdentity API.
  3. AWS validates the token against the OIDC provider configured in your account and returns temporary credentials scoped to AWS_INFRA_ROLE_ARN.
  4. Subsequent steps in the job use those credentials transparently — no secrets are exposed in logs.
- name: Configure AWS credentials
  uses: aws-actions/configure-aws-credentials@v4
  with:
    role-to-assume: ${{ secrets.AWS_INFRA_ROLE_ARN }}
    aws-region: ${{ env.AWS_REGION }}
The AWS_INFRA_ROLE_ARN secret must be set on each GitHub Actions environment (infra-dev, infra-qa, infra-prod) and must reference an IAM role whose trust policy allows sts:AssumeRoleWithWebIdentity from the GitHub OIDC provider (token.actions.githubusercontent.com) for your repository.

Manual dispatch

Both workflows expose a workflow_dispatch trigger, allowing you to deploy to any environment outside of a branch push — useful for first-time setup, rollbacks, or deploying infrastructure changes before the template file is merged to a tracked branch. The trigger block structure is identical in both workflows — they differ only in the path filter. The infrastructure workflow monitors devops/infrastructure/template.yml; the scheduler workflow monitors devops/scheduler/template.yml:
# deploy-infrastructure.yml
on:
  push:
    branches: ["develop", "quality", "main"]
    paths:
      - "devops/infrastructure/template.yml"
  workflow_dispatch:
    inputs:
      environment:
        description: 'Environment (dev/qa/prod)'
        default: 'dev'
# deploy-scheduler.yml
on:
  push:
    branches: ["develop", "quality", "main"]
    paths:
      - "devops/scheduler/template.yml"
  workflow_dispatch:
    inputs:
      environment:
        description: 'Environment (dev/qa/prod)'
        default: 'dev'
To trigger manually from the GitHub UI: navigate to Actions → Deploy Infrastructure (or Deploy Scheduler) → Run workflow, select the target branch, choose the environment, and click Run workflow.

Enabling and disabling workflows

Both workflows are gated behind GitHub Actions repository variables that act as feature flags. Neither workflow will run — even on a matching push — if the flag is not set to true.
VariableWorkflowEffect
WORKFLOW_INFRASTRUCTURE_ENABLEDdeploy-infrastructure.ymlSet to true to enable automatic infrastructure deploys. Any other value (or absent) skips both jobs.
WORKFLOW_SCHEDULER_ENABLEDdeploy-scheduler.ymlSet to true to enable automatic scheduler deploys.
These variables are evaluated in the if condition of both the determine-env and deploy jobs:
if: ${{ vars.WORKFLOW_INFRASTRUCTURE_ENABLED == 'true' }}
Set or update these variables under Settings → Secrets and variables → Actions → Variables in your GitHub repository. Because the workflows use GitHub Actions environments (infra-dev, infra-qa, infra-prod), you can set the variables at the environment level to enable deployments only for specific environments.
no-fail-on-empty-changeset: "1" is set in both workflows. If you push a change unrelated to the CloudFormation templates — such as a README update — and the path filter still causes the workflow to run, CloudFormation will detect no changes in the stack and the job will exit successfully rather than failing with a No updates are to be performed error.

Build docs developers (and LLMs) love