Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature infra enchancements #7

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions .github/workflows/aws-template-terraform.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: AWS Bootstrap Workflow
name: AWS Template Workflow

on:
workflow_call:
Expand Down Expand Up @@ -52,6 +52,23 @@ jobs:
done < files.txt
echo "infra_changed=$infra_changed" >> "$GITHUB_OUTPUT"

scan:
name: Scan TF Code
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run tfsec
uses: aquasecurity/tfsec-sarif-action@21ded20e8ca120cd9d3d6ab04ef746477542a608
with:
working_directory: ${{ inputs.CONTEXT_FOLDER }}
sarif_file: tfsec.sarif
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: tfsec.sarif
needs: [check_changes]

deploy_infra:
name: Deploy Infra
runs-on: ubuntu-latest
Expand All @@ -62,7 +79,7 @@ jobs:
TF_VAR_environment: ${{ vars.ENVIRONMENT_NAME }}
TF_VAR_kms_key_name: ${{ vars.KMS_KEY_NAME }}
TF_VAR_vpc_id: ${{ vars.VPC_ID }}
needs: [check_changes]
needs: [scan]
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
28 changes: 23 additions & 5 deletions .github/workflows/deploy-infra-dev.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,32 @@
name: Deploy AWS Infra to Dev
name: Publish Infra

on:
# PR targeting master is created or new commits are pushed
push:
branches:
- master
paths:
- "infrastructure/**"

# Manual trigger via GH Actions UI
workflow_dispatch:
inputs:
environment:
description: "Select target environment"
required: true
default: "dev"
type: choice
options:
- dev
- test
- prod

jobs:
infrastructure_deploy_dev:
deploy:
uses: ./.github/workflows/aws-template-terraform.yml
with:
CONTEXT_FOLDER: ./infrastructure/cloud/environments/dev
CHANGE_FOLDER_NAME: environments/dev
ENVIRONMENT_NAME: dev
CONTEXT_FOLDER: "./infrastructure/cloud/environments/${{ inputs.environment }}"
CHANGE_FOLDER_NAME: environments/${{ inputs.environment }}
ENVIRONMENT_NAME: ${{ inputs.environment }}
TEST_BUCKET_NAME: jasper-test-bucket
secrets: inherit
Loading