Replace GitHub Actions artifact with MinIO upload
All checks were successful
Code Quality & Security Scan / TFLint (push) Successful in 20s
Code Quality & Security Scan / Tfsec Security Scan (push) Successful in 31s
Code Quality & Security Scan / Checkov Security Scan (push) Successful in 37s
Code Quality & Security Scan / SonarQube Trigger (push) Successful in 37s
Code Quality & Security Scan / Terraform Init (push) Successful in 1m4s

- Removed actions/upload-artifact@v4 (not supported in Gitea)
- Added terraform show output to create human-readable plan text
- Upload both binary plan and text version to MinIO
- Plan stored at: s3://bucket/terraform-plans/repo/run-number/
- Uses existing AWS CLI with S3-compatible endpoint
This commit is contained in:
Patrick de Ruiter 2025-11-02 01:36:11 +01:00
parent 810e85562c
commit 66e05bb105
Signed by: pderuiter
GPG Key ID: 5EBA7F21CF583321

View File

@ -125,11 +125,27 @@ jobs:
TF_VAR_cluster_name: ${{ secrets.VSPHERE_CLUSTER }}
TF_VAR_environment: ${{ secrets.ENVIRONMENT }}
VAULT_ADDR: ${{ secrets.VAULT_ADDR }}
run: terraform plan -out=tfplan
run: |
terraform plan -out=tfplan
terraform show -no-color tfplan > tfplan.txt
- name: Upload Terraform Plan
uses: actions/upload-artifact@v4
with:
name: terraform-plan
path: tfplan
retention-days: 30
- name: Upload Terraform Plan to MinIO
env:
AWS_ACCESS_KEY_ID: ${{ secrets.MINIO_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.MINIO_SECRET_KEY }}
MINIO_ENDPOINT: ${{ secrets.MINIO_ENDPOINT }}
MINIO_BUCKET: ${{ secrets.MINIO_BUCKET }}
run: |
# Install AWS CLI for S3-compatible operations
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip -q awscliv2.zip
sudo ./aws/install
# Upload plan files to MinIO
PLAN_PATH="terraform-plans/${{ github.repository }}/${{ github.run_number }}"
aws s3 cp tfplan "s3://${MINIO_BUCKET}/${PLAN_PATH}/tfplan" \
--endpoint-url="${MINIO_ENDPOINT}"
aws s3 cp tfplan.txt "s3://${MINIO_BUCKET}/${PLAN_PATH}/tfplan.txt" \
--endpoint-url="${MINIO_ENDPOINT}"
echo "Plan uploaded to: s3://${MINIO_BUCKET}/${PLAN_PATH}/"