Skip to content

Commit 5080d6f

Browse files
committed
fix workflow env
1 parent 7753a8d commit 5080d6f

2 files changed

Lines changed: 14 additions & 15 deletions

File tree

.github/workflows/cd-ecs.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ on:
3939
description: "Target environment"
4040
required: true
4141
type: choice
42-
options: [staging, production]
42+
options: [staging, prod]
4343
default: staging
4444

4545
permissions:
@@ -68,8 +68,7 @@ jobs:
6868
timeout-minutes: 20
6969
if: >
7070
(github.event_name == 'workflow_run'
71-
&& github.event.workflow_run.conclusion == 'success')
72-
|| (github.event_name == 'workflow_dispatch'
71+
&& github.event.workflow_run.conclusion == 'success')|| (github.event_name == 'workflow_dispatch'
7372
&& inputs.environment == 'staging')
7473
environment: staging
7574
strategy:
@@ -255,7 +254,7 @@ jobs:
255254
runs-on: ubuntu-latest
256255
timeout-minutes: 20
257256
if: startsWith(github.ref, 'refs/tags/v')
258-
environment: production
257+
environment: prod
259258
strategy:
260259
matrix:
261260
service: [backend, frontend]
@@ -315,7 +314,7 @@ jobs:
315314
runs-on: ubuntu-latest
316315
timeout-minutes: 5
317316
needs: [build-production]
318-
environment: production
317+
environment: prod
319318
steps:
320319
- name: Dispatch terraform-apply to infra repo
321320
uses: actions/github-script@v7
@@ -348,7 +347,7 @@ jobs:
348347
runs-on: ubuntu-latest
349348
timeout-minutes: 20
350349
needs: [infra-production]
351-
environment: production
350+
environment: prod
352351
strategy:
353352
matrix:
354353
service: [backend, frontend]

.github/workflows/cd-eks-gitops.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
uses: ./.github/workflows/_build-and-push.yml
8383
with:
8484
git-ref: ${{ github.event.workflow_run.head_sha || github.sha }}
85-
env-name: dev
85+
env-name: ${{ inputs.environment }}
8686
tags: |
8787
type=raw,value=dev
8888
type=sha,prefix=dev-,format=short
@@ -101,7 +101,7 @@ jobs:
101101
needs: [build-dev]
102102
runs-on: ubuntu-latest
103103
timeout-minutes: 30
104-
environment: dev
104+
environment: ${{ inputs.environment }}
105105
permissions:
106106
contents: read
107107
id-token: write
@@ -110,7 +110,7 @@ jobs:
110110

111111
- uses: ./.github/actions/deploy-env
112112
with:
113-
gitops-env: dev
113+
gitops-env: ${ inputs.environment }
114114
image-tag: ${{ format('dev-{0}', needs.build-dev.outputs.sha-short) }}
115115
gitops-repo: ${{ github.repository_owner }}/mypythonproject1-gitops
116116
eks-cluster-name: mypythonproject1-dev-eks
@@ -151,7 +151,7 @@ jobs:
151151
uses: ./.github/workflows/_build-and-push.yml
152152
with:
153153
git-ref: ${{ github.event.workflow_run.head_sha || github.sha }}
154-
env-name: staging
154+
env-name: ${{ inputs.environment }}
155155
tags: |
156156
type=raw,value=staging
157157
type=sha,prefix=staging-,format=short
@@ -170,7 +170,7 @@ jobs:
170170
needs: [build-staging]
171171
runs-on: ubuntu-latest
172172
timeout-minutes: 30
173-
environment: staging
173+
environment: ${{ inputs.environment }}
174174
permissions:
175175
contents: read
176176
id-token: write
@@ -179,7 +179,7 @@ jobs:
179179

180180
- uses: ./.github/actions/deploy-env
181181
with:
182-
gitops-env: staging
182+
gitops-env: ${ inputs.environment }
183183
image-tag: ${{ format('staging-{0}', needs.build-staging.outputs.sha-short) }}
184184
gitops-repo: ${{ github.repository_owner }}/mypythonproject1-gitops
185185
eks-cluster-name: mypythonproject1-staging-eks
@@ -255,7 +255,7 @@ jobs:
255255
uses: ./.github/workflows/_build-and-push.yml
256256
with:
257257
git-ref: ${{ github.ref }}
258-
env-name: prod
258+
env-name: ${{ inputs.environment }}
259259
tags: |
260260
type=semver,pattern={{version}}
261261
type=semver,pattern={{major}}.{{minor}}
@@ -277,7 +277,7 @@ jobs:
277277
needs: [build-production]
278278
runs-on: ubuntu-latest
279279
timeout-minutes: 35
280-
environment: prod
280+
environment: ${{ inputs.environment }}
281281
permissions:
282282
contents: read
283283
id-token: write
@@ -286,7 +286,7 @@ jobs:
286286

287287
- uses: ./.github/actions/deploy-env
288288
with:
289-
gitops-env: prod
289+
gitops-env: ${{ inputs.environment }}
290290
image-tag: ${{ github.ref_name }}
291291
gitops-repo: ${{ github.repository_owner }}/mypythonproject1-gitops
292292
eks-cluster-name: mypythonproject1-prod-eks

0 commit comments

Comments
 (0)