Initial setup of gitea actions

This commit is contained in:
2026-07-05 18:36:41 +02:00
parent 040f7a382f
commit ebbb1254fb
13 changed files with 468 additions and 2 deletions
+63
View File
@@ -0,0 +1,63 @@
name: OpenTofu K8s Apps Validate on Pull Request
on:
pull_request:
branches:
- main
paths:
- "terraform/apps/**"
types:
- opened
- synchronize
- reopened
jobs:
iac-validate:
runs-on: cicd-base
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup environment
uses: ./.gitea/actions/setup-env
- name: Setup Ansible Environment
id: setup_ansible_env
uses: ./.gitea/actions/setup-ansible-env
with:
project-id: ${{ secrets.BW_PROJECT_ID }}
organization-id: ${{ secrets.BW_ORGANIZATION_ID }}
access-token: ${{ secrets.BW_ACCESS_TOKEN }}
ansible-user: ${{ secrets.ANSIBLE_USER }}
host-group: microk8s
- name: Setup OpenTofu Environment
uses: ./.gitea/actions/setup-opentofu-env
- name: Setup Kubernetes Environment
uses: ./.gitea/actions/setup-k8s-env
with:
project-id: ${{ secrets.BW_PROJECT_ID }}
organization-id: ${{ secrets.BW_ORGANIZATION_ID }}
access-token: ${{ secrets.BW_ACCESS_TOKEN }}
ansible-user: ${{ secrets.ANSIBLE_USER }}
- name: OpenTofu Init and Validate
env:
BW_PROJECT_ID: ${{ secrets.BW_PROJECT_ID }}
BW_ORGANIZATION_ID: ${{ secrets.BW_ORGANIZATION_ID }}
BW_ACCESS_TOKEN: ${{ secrets.BW_ACCESS_TOKEN }}
run: |
cd terraform/apps/dev-01
sectool -f ../../sectool.json exec tofu init
sectool -f ../../sectool.json exec tofu validate
sectool -f ../../sectool.json exec tofu fmt -check
sectool -f ../../sectool.json exec tofu plan
cd terraform/apps/prod-01
sectool -f ../../sectool.json exec tofu init
sectool -f ../../sectool.json exec tofu validate
sectool -f ../../sectool.json exec tofu fmt -check
sectool -f ../../sectool.json exec tofu plan