Skip to content

Commit

Permalink
Using workflow dispatch and environment secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasantarella committed Mar 18, 2023
1 parent 8077341 commit 652bfee
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
21 changes: 18 additions & 3 deletions .github/workflows/cd-infrastructure.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
name: Infrastructure CD
on:
workflow_dispatch:
inputs:
environment:
description: 'Environment'
required: true
type: choice
default: 'Development'
choices:
- 'Development'
- 'Staging'
- 'Production'
runway-tags:
required: false
type: string
default: 'ci'
workflow_call:
inputs:
environment:
Expand All @@ -16,8 +31,8 @@ on:
type: string
default: 'ci'
secrets:
aws-iam-assume-role-arn:
required: true
AWS_IAM_ASSUME_ROLE_ARN:
required: false
outputs:
s3-bucket-id:
description: 'S3 bucket ID'
Expand Down Expand Up @@ -54,7 +69,7 @@ jobs:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.aws-iam-assume-role-arn }}
role-to-assume: ${{ secrets.AWS_IAM_ASSUME_ROLE_ARN }}
role-session-name: github-actions
aws-region: ${{ inputs.aws-region || vars.AWS_REGION }}
- name: Runway Deploy
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/cicd-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,3 @@ jobs:
cloudfront-distribution-id: ${{ needs.infrastructure.outputs.cloudfront_distribution_id }}
aws-region: ${{ needs.infrastructure.outputs.aws_region }}
artifact-name: ${{ needs.build.outputs.artifact-name }}
secrets:
aws-iam-assume-role-arn: ${{ secrets.AWS_IAM_ASSUME_ROLE_ARN }}

0 comments on commit 652bfee

Please sign in to comment.