46 lines
1.1 KiB
YAML
46 lines
1.1 KiB
YAML
name: Terraform K8S Apps apply
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- "terraform/k8sapps/**"
|
|
|
|
jobs:
|
|
terraform-apply:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup environment
|
|
uses: ./.github/actions/setup-env
|
|
|
|
- name: Setup Ansible Environment
|
|
uses: ./.github/actions/setup-ansible-env
|
|
|
|
- name: Setup Terraform Environment
|
|
uses: ./.github/actions/setup-terraform-env
|
|
|
|
- name: Setup Kubernetes Environment
|
|
uses: ./.github/actions/setup-k8s-env
|
|
|
|
- name: Terraform Init
|
|
env:
|
|
VAULT_MASTER_PASSWORD: ${{ secrets.VAULT_MASTER_PASSWORD }}
|
|
run: |
|
|
cd terraform/k8sapps
|
|
sectool exec terraform init
|
|
|
|
- name: Terraform Apply
|
|
env:
|
|
VAULT_MASTER_PASSWORD: ${{ secrets.VAULT_MASTER_PASSWORD }}
|
|
ANSIBLE_USER: ${{ secrets.ANSIBLE_USER }}
|
|
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
|
|
run: |
|
|
# Apply the Terraform configuration
|
|
cd terraform/k8sapps
|
|
sectool exec terraform apply --auto-approve
|