Refactor workflow file paths and update branch restrictions
This commit is contained in:
@@ -8,6 +8,7 @@ on:
|
||||
- main
|
||||
paths:
|
||||
- "terraform/iac/**"
|
||||
- .github/workflows/terraform-iac-apply.yml
|
||||
|
||||
jobs:
|
||||
terraform-apply:
|
||||
@@ -22,19 +23,28 @@ jobs:
|
||||
- name: Setup environment
|
||||
uses: ./.github/actions/setup-env
|
||||
|
||||
- name: Setup Terraform Environment
|
||||
uses: ./.github/actions/setup-terraform-env
|
||||
- name: Setup Ansible environment
|
||||
uses: ./.github/actions/setup-ansible-env
|
||||
with:
|
||||
vault-master-password: ${{ secrets.VAULT_MASTER_PASSWORD }}
|
||||
ansible-user: ${{ secrets.ANSIBLE_USER }}
|
||||
|
||||
- name: Get Host Info
|
||||
uses: ./.github/actions/get-host-info
|
||||
id: get-host-info
|
||||
with:
|
||||
vault-master-password: ${{ secrets.VAULT_MASTER_PASSWORD }}
|
||||
ansible-user: ${{ secrets.ANSIBLE_USER }}
|
||||
|
||||
- name: Setup Terraform environment
|
||||
uses: ./.github/actions/setup-terraform-env
|
||||
|
||||
- name: Terraform Init
|
||||
env:
|
||||
VAULT_MASTER_PASSWORD: ${{ secrets.VAULT_MASTER_PASSWORD }}
|
||||
SYSTEM_ID: ${{ steps.get-host-info.outputs.system-id }}
|
||||
run: |
|
||||
cd terraform/iac
|
||||
export TF_VAR_system_id=$SYSTEM_ID
|
||||
sectool exec terraform init
|
||||
|
||||
- name: Terraform Apply
|
||||
env:
|
||||
VAULT_MASTER_PASSWORD: ${{ secrets.VAULT_MASTER_PASSWORD }}
|
||||
run: |
|
||||
cd terraform/iac
|
||||
sectool exec terraform apply --auto-approve
|
||||
|
||||
Reference in New Issue
Block a user