Skip to content

Commit

Permalink
reusable workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
chrispsheehan committed Jan 10, 2024
1 parent 3a11431 commit 119a75a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Deploy Dev

on:
workflow_dispatch:
push:
branches: main

jobs:
deploy:
uses: ./.github/workflows/deploy-environment.yml
with:
stage: dev
17 changes: 8 additions & 9 deletions .github/workflows/deploy-environment.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
name: Deploy Main
name: Deploy Environment

on:
workflow_dispatch:
push:
branches:
- main

workflow_call:
inputs:
stage:
required: true
type: string
env:
aws_account_id: ${{ vars.AWS_ACCOUNT_ID }}
aws_region: ${{ vars.AWS_REGION }}
aws_role: ${{ vars.AWS_ROLE }}
stage: dev

jobs:
terraform-check:
Expand Down Expand Up @@ -52,7 +51,7 @@ jobs:
aws_region: ${{ env.aws_region }}
aws_role: ${{ env.aws_role }}
terraform_action: apply
stage: ${{ env.stage }}
stage: ${{ inputs.stage }}

terraform-destroy:
runs-on: ubuntu-latest
Expand All @@ -74,4 +73,4 @@ jobs:
aws_region: ${{ env.aws_region }}
aws_role: ${{ env.aws_role }}
terraform_action: destroy
stage: ${{ env.stage }}
stage: ${{ inputs.stage }}

0 comments on commit 119a75a

Please sign in to comment.