feat: merge scenarios #47
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Scenario 1: Terraform SPOKE Multi-tenant Secure Baseline' | |
on: | |
workflow_dispatch: | |
inputs: | |
destroy: | |
description: 'Destroy resources?' | |
required: true | |
type: boolean | |
default: false | |
push: | |
branches: | |
- main | |
paths: | |
- '.github/workflows/scenario1.terraform.spoke.yml' | |
- '.github/workflows/_template.terraform.yml' | |
- 'scenarios/secure-baseline-multitenant/terraform/spoke/**' | |
- '!scenarios/secure-baseline-multitenant/terraform/spoke/**.md' | |
pull_request: | |
branches: | |
- main | |
paths: | |
- '.github/workflows/scenario1.terraform.spoke.yml' | |
- '.github/workflows/_template.terraform.yml' | |
- 'scenarios/secure-baseline-multitenant/terraform/spoke/**' | |
- '!scenarios/secure-baseline-multitenant/terraform/spoke/**.md' | |
permissions: | |
id-token: write | |
contents: read | |
pull-requests: write | |
env: | |
modulePath: 'scenarios/secure-baseline-multitenant/terraform/spoke' | |
terraformVersion: 1.5.2 # must be greater than or equal to 1.2 for OIDC | |
backendStateKey: 'scenario1.spoke.tfstate' | |
tfvarPath: 'Parameters/uat.tfvars' | |
jobs: | |
prepare-environment: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@main | |
outputs: | |
modulePath: ${{ env.modulePath }} | |
terraformVersion: ${{ env.terraformVersion }} | |
backendStateKey: ${{ env.backendStateKey }} | |
tfvarPath: ${{ env.tfvarPath }} | |
call-workflow-passing-data: | |
name: 'Terraform CICD test' | |
needs: | |
- prepare-environment | |
uses: ./.github/workflows/.template.terraform.yml | |
with: | |
modulePath: ${{ needs.prepare-environment.outputs.modulePath }} | |
terraformVersion: ${{ needs.prepare-environment.outputs.terraformVersion }} | |
backendStateKey: ${{ needs.prepare-environment.outputs.backendStateKey }} | |
tfvarPath: ${{ needs.prepare-environment.outputs.tfvarPath }} | |
# Ensure this value is a boolean | |
destroy: ${{ github.event.inputs.destroy == 'true' }} | |
secrets: inherit |