12 Commits

Author SHA1 Message Date
Damien
3ce22b493c Add shell specification to Terraform plan steps
Some checks failed
Terraform Deploy / Validate (push) Successful in 5s
Terraform Deploy / Apply (push) Has been cancelled
Terraform Deploy / Plan (push) Has been cancelled
2026-06-10 09:29:24 +02:00
Damien
96394ab1b1 Update Terraform workflow file paths and output handling
All checks were successful
Terraform Deploy / Validate (push) Successful in 5s
Terraform Deploy / Plan (push) Successful in 5s
Terraform Deploy / Apply (push) Successful in 1m39s
- Change single quotes to double quotes in path filters for consistency
- Modify command redirection to use > instead of | tee for cleaner
  output handling
- Add explicit cat command to display plan output in logs
- Standardize whitespace formatting throughout files
2026-05-03 21:07:27 +02:00
f57f68b6f3 feat: add SSH key env vars to PR workflow
All checks were successful
Terraform PR / Validate (pull_request) Successful in 6s
Terraform PR / Plan (pull_request) Successful in 10s
Inject PROXMOX_SSH_PRIVATE_KEY and ADMIN_SSH_PUBLIC_KEY
secrets as TF_VAR_ environment variables for CI.
2026-05-03 17:04:10 +00:00
b4fa69f00a feat: add SSH key env vars to deploy workflow
Inject PROXMOX_SSH_PRIVATE_KEY and ADMIN_SSH_PUBLIC_KEY
secrets as TF_VAR_ environment variables for CI.
2026-05-03 17:03:33 +00:00
7bae079670 refactor(ci): remove old unified workflow
Replaced by:
- terraform-pr.yml (for pull requests)
- terraform-deploy.yml (for push to dev)

Refs #3
2025-12-08 16:27:03 +00:00
804b94a837 feat(ci): create dedicated deploy workflow for Terraform
All checks were successful
Terraform Deploy / Validate (push) Successful in 4s
Terraform Deploy / Plan (push) Successful in 4s
Terraform Deploy / Apply (push) Has been skipped
- Separate workflow for push events to dev only
- Apply job runs when plan detects changes
- Use has_changes output (true/false) instead of exitcode

Refs #3
2025-12-08 16:26:44 +00:00
349f967fc0 feat(ci): create dedicated PR workflow for Terraform
- Separate workflow for pull_request events only
- No Apply job visible in PR checks
- Simplified checkout using gitea.head_ref directly

Refs #3
2025-12-08 16:26:26 +00:00
bf80e60d7f fix(ci): use head_ref for PR checkout instead of ref_name
All checks were successful
Terraform CI/CD / Validate (push) Successful in 5s
Terraform CI/CD / Plan (push) Successful in 5s
Terraform CI/CD / Apply (push) Has been skipped
- gitea.ref_name returns PR number for pull_request events
- Use gitea.head_ref (source branch) for PRs
- Use gitea.ref_name for push events
- Remove unnecessary git checkout sha step
- Clean up redundant Save Plan Output step

Refs #3
2025-12-08 15:56:31 +00:00
darnodo
bb39dfa29e ci: add GIT_TOKEN authentication to checkout steps
All checks were successful
Terraform CI/CD / Validate (push) Successful in 6s
Terraform CI/CD / Plan (push) Successful in 8s
Terraform CI/CD / Apply (push) Has been skipped
The workflow was failing to checkout the repository in certain contexts or was requiring authentication that wasn't previously provided. This change:
- Adds the `GIT_TOKEN` secret to the environment variables.
- Updates the `git clone` commands in the `terraform-plan`, `terraform-apply`, and `terraform-destroy` jobs to include the `${GIT_TOKEN}@` prefix in the clone URL.

This ensures that the workflow can successfully clone the repository even if it's private or requires authenticated access.
2025-12-08 11:56:05 +01:00
darnodo
a02582aaea ci(workflow): hardcode gitea server url in terraform workflow
Some checks failed
Terraform CI/CD / Validate (push) Failing after 2s
Terraform CI/CD / Plan (push) Has been skipped
Terraform CI/CD / Apply (push) Has been skipped
Replaces the dynamic `${{ gitea.server_url }}` variable with the explicit URL `https://gitea.arnodo.fr` in the Terraform workflow configuration. This change affects git clone operations and API calls for posting PR comments, likely to resolve issues with variable expansion or DNS resolution within the runner environment.
2025-12-08 11:31:46 +01:00
ba4b530635 fix(ci): replace actions/checkout with git clone
Some checks failed
Terraform CI/CD / Validate (push) Failing after 1s
Terraform CI/CD / Plan (push) Has been skipped
Terraform CI/CD / Apply (push) Has been skipped
- Remove actions/checkout@v4 (requires Node.js not in Alpine image)
- Use native git clone instead
- Remove actions/upload-artifact and download-artifact (require Node.js)
- Re-run plan in apply job instead of artifact transfer
- Add workflow file to paths trigger for testing

Refs #3
2025-12-08 09:00:24 +00:00
6036783cd5 feat(ci): Add Terraform CI/CD pipeline (#4)
## 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

Reviewed-on: #4
2025-12-08 08:52:43 +00:00