chore: Add markdown files

This commit is contained in:
2025-09-27 18:59:45 +10:00
parent 48bdaf28ec
commit f35163b5cd
5 changed files with 151 additions and 4 deletions

View File

@@ -4,23 +4,28 @@ on:
push:
branches:
- master
paths:
- '**.tf'
jobs:
opentofu:
if: github.repository == 'comprofix/opentofu-homelab'
name: Opentofu Build
runs-on: self-hosted
container:
image: node:20-bullseye
env:
PG_CONN_STR: ${{ secrets.PG_CONN_STR }} # available to all steps
PG_CONN_STR: ${{ secrets.PG_CONN_STR }} # PostgreSQL backend connection string
steps:
# 1. Checkout code
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-depth: 0
# 2. Generate dynamic Terraform/Opentofu vars from secrets
- name: Generate Dynamic Vars (Secrets)
run: |
cat <<EOF > terraform.auto.tfvars
@@ -32,27 +37,34 @@ jobs:
ssh_key = "${{ secrets.SSH_PRIVATE_KEY }}"
passphrase = "${{ secrets.SSH_PASSPHRASE }}"
EOF
# 3. Setup Opentofu CLI
- name: Setup Opentofu
uses: opentofu/setup-opentofu@v1
# 4. Format the secrets/vars file (required by tofu fmt)
- name: Format vars file
run: tofu fmt terraform.auto.tfvars
# 5. Initialize Opentofu backend and providers
- name: Opentofu Init
run: tofu init
# 6. Full formatting/lint check for all files
- name: Opentofu Format Check
run: tofu fmt -check -recursive
# 7. Validate configuration
- name: Opentofu Validate
run: tofu validate
# 8. Plan changes
- name: Opentofu Plan
id: plan
run: |
tofu plan -out=tfplan -detailed-exitcode
# 9. Apply changes only if previous steps succeed
- name: Opentofu Apply
if: success()
run: tofu apply -auto-approve tfplan