2121 Use code from : ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
2222 (Git ref to deploy, for example, a tag, branch name or commit SHA. Will use workflow ref if not provided.)
2323 type : string
24+ workflow_call :
25+ inputs :
26+ environment :
27+ description : Deployment environment
28+ required : true
29+ type : string
30+ git_ref_to_deploy :
31+ description : Git ref to deploy, for example, a tag, branch name or commit SHA
32+ type : string
33+ required : true
2434
2535permissions : {}
2636
2737env :
2838 environment : ${{ inputs.environment }}
29- deployment_type : ${{ inputs.deployment_type }}
30- db_snapshot_arn : ${{ inputs.db_snapshot_arn }}
31- egress_cidr : ${{ inputs.egress_cidr }}
32- take_db_snapshot : ${{ inputs.take_db_snapshot }}
3339 git_ref_to_deploy : ${{ inputs.git_ref_to_deploy || github.sha }}
3440 aws_role : ${{ inputs.environment == 'production'
3541 && 'arn:aws:iam::820242920762:role/GithubDeployDataReplicationInfrastructure'
@@ -125,7 +131,7 @@ jobs:
125131 - name : Rename task definition file
126132 run : mv ${{ steps.create-task-definition.outputs.task-definition }} ${{ runner.temp }}/data-replication-task-definition.json
127133 - name : Upload artifact for data-replication task definition
128- uses : actions/upload-artifact@v5
134+ uses : actions/upload-artifact@v6
129135 with :
130136 name : ${{ inputs.environment }}-data-replication-task-definition
131137 path : ${{ runner.temp }}/data-replication-task-definition.json
@@ -134,7 +140,7 @@ jobs:
134140 name : Notify on approval required
135141 runs-on : ubuntu-latest
136142 needs : prepare-deployment
137- if : ${{ inputs.environment == 'production' }}
143+ if : ${{ inputs.environment == 'production' && github.event_name == 'workflow_dispatch' }}
138144 steps :
139145 - name : Notify pending approval
140146 if : inputs.environment == 'production'
@@ -160,7 +166,7 @@ jobs:
160166 name : Wait for approval if required
161167 runs-on : ubuntu-latest
162168 needs : prepare-deployment
163- environment : ${{ inputs.environment }}
169+ environment : ${{ github.event_name == 'workflow_dispatch' && inputs.environment || null }}
164170 steps :
165171 - run : echo "Proceeding with deployment to $environment environment"
166172
@@ -177,7 +183,7 @@ jobs:
177183 role-to-assume : ${{ env.aws_role }}
178184 aws-region : eu-west-2
179185 - name : Download data-replication task definition artifact
180- uses : actions/download-artifact@v6
186+ uses : actions/download-artifact@v7
181187 with :
182188 path : ${{ runner.temp }}
183189 name : ${{ inputs.environment }}-data-replication-task-definition
0 commit comments