Skip to content

Commit

Permalink
fix: tell GHA diffing the infra is not a deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
wolverian committed Sep 12, 2024
1 parent 56306a1 commit 40574f7
Showing 1 changed file with 26 additions and 6 deletions.
32 changes: 26 additions & 6 deletions .github/workflows/deploy-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
jobs:
deploy:
name: Deploy to ${{ inputs.env }} (${{ inputs.account_id }})
if: github.ref_name == 'main'
runs-on: ubuntu-latest
environment: ${{ inputs.env }}
env:
Expand All @@ -28,15 +29,34 @@ jobs:
with:
aws-region: eu-west-1
role-to-assume: arn:aws:iam::${{ env.ACCOUNT_ID }}:role/kitu-github-actions-role
- name: Diff
if: github.ref_name != 'main'
run: |
npm ci
npx cdk diff --all --require-approval=never
working-directory: infra
- name: Deploy
if: github.ref_name == 'main'
run: |
npm ci
npx cdk deploy --all --require-approval=never
working-directory: infra

diff:
name: Diff to ${{ inputs.env }} (${{ inputs.account_id }})
if: github.ref_name != 'main'
runs-on: ubuntu-latest
env:
KITU_ENV: ${{ inputs.env }}
ACCOUNT_ID: ${{ inputs.account_id }}
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Log in to ${{ env.KITU_ENV }}
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: eu-west-1
role-to-assume: arn:aws:iam::${{ env.ACCOUNT_ID }}:role/kitu-github-actions-role
- name: Diff
if: github.ref_name != 'main'
run: |
npm ci
npx cdk diff --all --require-approval=never
working-directory: infra

0 comments on commit 40574f7

Please sign in to comment.