Upped versions #205
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Azure Terraform | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- .github/workflows/azure-terraform.yml | |
- terraform/azure/** | |
- "!**.md" | |
pull_request: | |
paths: | |
- .github/workflows/azure-terraform.yml | |
- terraform/azure/** | |
- "!**.md" | |
workflow_dispatch: | |
inputs: | |
debug: | |
description: Debug | |
type: boolean | |
workflow_call: | |
permissions: | |
contents: read | |
id-token: write | |
defaults: | |
run: | |
working-directory: terraform/azure | |
env: | |
path: terraform/azure | |
ARM_TENANT_ID: ${{ vars.AZURE_TENANT_ID }} | |
ARM_CLIENT_ID: ${{ vars.AZURE_CLIENT_ID }} | |
ARM_USE_OIDC: true | |
jobs: | |
build: | |
name: Build | |
runs-on: ${{ vars.RUNNER }} | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Set up Terraform | |
uses: hashicorp/setup-terraform@v2 | |
with: | |
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }} | |
- name: Terraform - Init | |
run: terraform init -input=false | |
- name: Terraform - Plan | |
run: terraform plan -out=tfplan -input=false | |
- name: Upload artifact | |
if: github.ref == 'refs/heads/main' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: tfplan | |
path: ${{ env.path }}/tfplan | |
- name: Debug | |
if: inputs.debug && (success() || failure()) | |
uses: mxschmitt/action-tmate@v3 | |
release: | |
name: Release | |
if: github.ref == 'refs/heads/main' | |
needs: build | |
runs-on: ${{ vars.RUNNER }} | |
environment: | |
name: dev | |
url: https://terraform.holm.io/ | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Download artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: tfplan | |
path: ${{ env.path }} | |
- name: Set up Terraform | |
uses: hashicorp/setup-terraform@v2 | |
with: | |
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }} | |
- name: Terraform - Init | |
run: terraform init -input=false | |
- name: Terraform - Apply | |
run: terraform apply -input=false tfplan | |
- name: Debug | |
if: inputs.debug && (success() || failure()) | |
uses: mxschmitt/action-tmate@v3 |