feat(ci): Add Terraform CI/CD pipeline #4

Merged
Damien merged 3 commits from feat/cicd-terraform into dev 2025-12-08 08:52:43 +00:00
Owner

Description

Mise en place d'un pipeline CI/CD Gitea Actions pour automatiser le déploiement Terraform.

Changements

  • Ajout du workflow .gitea/workflows/terraform.yml
  • Utilisation de l'image custom gitea.arnodo.fr/damien/terraform-ci:latest (Terraform 1.5.7 + TFLint)
  • Exécution dans des containers Docker (pas sur le host)

Pipeline

Job Trigger Actions
validate Push + PR terraform fmt -check, tflint, terraform validate
plan Push + PR terraform plan + commentaire automatique sur la PR
apply Push sur dev uniquement terraform apply (si changements détectés)

Secrets configurés

  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY
  • PROXMOX_URL
  • PROXMOX_API_TOKEN
  • TAILSCALE_AUTH_KEY
  • GIT_TOKEN

Test

Cette PR va déclencher les jobs validate et plan. Le job apply se déclenchera après le merge sur dev.

Closes #3

## Description Mise en place d'un pipeline CI/CD Gitea Actions pour automatiser le déploiement Terraform. ## Changements - Ajout du workflow `.gitea/workflows/terraform.yml` - Utilisation de l'image custom `gitea.arnodo.fr/damien/terraform-ci:latest` (Terraform 1.5.7 + TFLint) - Exécution dans des containers Docker (pas sur le host) ## Pipeline | Job | Trigger | Actions | |-----|---------|---------| | **validate** | Push + PR | `terraform fmt -check`, `tflint`, `terraform validate` | | **plan** | Push + PR | `terraform plan` + commentaire automatique sur la PR | | **apply** | Push sur `dev` uniquement | `terraform apply` (si changements détectés) | ## Secrets configurés - [x] `AWS_ACCESS_KEY_ID` - [x] `AWS_SECRET_ACCESS_KEY` - [x] `PROXMOX_URL` - [x] `PROXMOX_API_TOKEN` - [x] `TAILSCALE_AUTH_KEY` - [x] `GIT_TOKEN` ## Test Cette PR va déclencher les jobs `validate` et `plan`. Le job `apply` se déclenchera après le merge sur `dev`. Closes #3
Damien added 3 commits 2025-12-08 08:23:42 +00:00
Implements automated Terraform pipeline with:
- Validation: fmt check, tflint, terraform validate
- Plan: on all PRs and pushes, with PR comments
- Apply: automatic on push to dev (when changes detected)

Runner: self-hosted (Docker) with Tailscale access to PVE01
Backend: Scaleway S3 Object Storage

Closes #3
- Use gitea.arnodo.fr/damien/terraform-ci:latest (Terraform 1.5.7 + TFLint)
- Remove setup-terraform and setup-tflint actions (already in image)
- Replace actions/github-script with curl + Gitea API for PR comments
- Use gitea.* context variables instead of github.*
- Fix plan exit code handling (0=no changes, 2=changes, 1=error)

Refs #3
GITEA_TOKEN is a reserved name in Gitea Actions

Refs #3
Damien merged commit 6036783cd5 into dev 2025-12-08 08:52:43 +00:00
Damien deleted branch feat/cicd-terraform 2025-12-08 08:52:49 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Damien/iac-homelab#4