commit ff142cccd8f4985ae276e21bca7a16c10e5fb866 Author: lucasdpt Date: Mon Mar 30 16:35:42 2026 +0200 feat: add terraform actions diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml new file mode 100644 index 0000000..11408da --- /dev/null +++ b/.gitea/workflows/release.yaml @@ -0,0 +1,16 @@ +name: semantic-release + +on: + push: + branches: + - master + - main + +permissions: + contents: write + issues: write + pull-requests: write + +jobs: + release: + uses: https://gitea.ldpt.fr/actions/semantic-release/.github/workflows/semantic-release.yml@58b6d322a5c5af1c45b637bc983f7f6476e8400e # v2.1.0 \ No newline at end of file diff --git a/release.config.js b/release.config.js new file mode 100644 index 0000000..64bf4cb --- /dev/null +++ b/release.config.js @@ -0,0 +1,12 @@ +module.exports = { + branches: ["main", "master"], + tagFormat: "v${version}", + plugins: [ + [ + "@semantic-release/commit-analyzer", + { + preset: "conventionalcommits" + } + ], + ] +}; diff --git a/terraform-apply/action.yml b/terraform-apply/action.yml new file mode 100644 index 0000000..a62cd02 --- /dev/null +++ b/terraform-apply/action.yml @@ -0,0 +1,30 @@ +name: Terraform Apply +description: Download the "terraform-plan" artifact and apply it + +inputs: + working-directory: + description: Directory containing the Terraform configuration + required: false + default: "." + +runs: + using: composite + steps: + - name: Setup Terraform + uses: hashicorp/setup-terraform@5e8dbf3c6d9deaf4193ca7a8fb23f2ac83bb6c85 # v4.0.0 + + - name: Terraform Init + shell: bash + working-directory: ${{ inputs.working-directory }} + run: terraform init + + - name: Download plan artifact + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: terraform-plan + path: ${{ inputs.working-directory }} + + - name: Terraform Apply + shell: bash + working-directory: ${{ inputs.working-directory }} + run: terraform apply -auto-approve tfplan diff --git a/terraform-plan/action.yml b/terraform-plan/action.yml new file mode 100644 index 0000000..91099fe --- /dev/null +++ b/terraform-plan/action.yml @@ -0,0 +1,31 @@ +name: Terraform Plan +description: Run terraform plan and publish the plan as an artifact named "terraform-plan" + +inputs: + working-directory: + description: Directory containing the Terraform configuration + required: false + default: "." + +runs: + using: composite + steps: + - name: Setup Terraform + uses: hashicorp/setup-terraform@5e8dbf3c6d9deaf4193ca7a8fb23f2ac83bb6c85 # v4.0.0 + + - name: Terraform Init + shell: bash + working-directory: ${{ inputs.working-directory }} + run: terraform init + + - name: Terraform Plan + shell: bash + working-directory: ${{ inputs.working-directory }} + run: terraform plan -out=tfplan + + - name: Upload plan artifact + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 + with: + name: terraform-plan + path: ${{ inputs.working-directory }}/tfplan + retention-days: 5