Github action for environment propagation in gitops repository.
Sample repository structure:
.
├── environments
│ ├── staging
│ │ ├── app
│ │ │ ├── Chart.yaml
│ │ │ ├── staging-values.yaml
│ │ │ ├── templates
│ │ │ │ ├── sealed-secret.yaml
│ │ │ └── values.yaml
│ │ └── staging-application.yaml
│ └── production
│ ├── app
│ │ ├── Chart.yaml
│ │ ├── production-values.yaml
│ │ ├── templates
│ │ │ ├── sealed-secret.yaml
│ │ └── values.yaml
│ └── production-application.yaml
└── README.md
Required Source environment(e.g. staging
).
Required Target environment(e.g. production
).
Required Prefix for folder in which environment is stored. Default environments
.
Required Suffix for folder in which environment is stored. Default app
.
Required Option to promote secret. Default false
.
# Promote a GitOps application from one environment to the next
name: Environment propagation
on:
workflow_dispatch:
inputs:
source_env:
description: 'Source environment'
required: true
default: 'staging'
type: choice
options:
- staging
- production
target_env:
description: 'Target environment'
required: true
default: 'production'
type: choice
options:
- staging
- production
jobs:
promote:
runs-on: ubuntu-latest
name: Propagate changes
steps:
- uses: actions/checkout@v3
- name: Propagate changes and create PR
id: hello
uses: simonmisencik/gitops-environment-propagation@main
with:
source_enviroment: ${{ inputs.source_env }}
target_enviroment: ${{ inputs.target_env }}
prefix_folder: 'environments'
suffix_folder: 'app'
Whether it is a small documentation correction, bug fix or new features, contributions are highly appreciated.