Compare commits
6 Commits
141-update
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 7d88890c3c | |||
| a54105e8e5 | |||
| b8ec5be269 | |||
| 875b8a0d90 | |||
| 81c589001b | |||
| baedfc1675 |
@@ -17,13 +17,3 @@ jobs:
|
||||
environment_name: test
|
||||
version_number: ${{ github.run_id }}
|
||||
secrets: inherit
|
||||
|
||||
terraform:
|
||||
if: ${{ needs.changes.outputs.infrastructure == 'true' }}
|
||||
name: terraform-plan
|
||||
needs:
|
||||
- changes
|
||||
uses: ./.gitea/workflows/infrastructure.yaml
|
||||
with:
|
||||
environment_name: test
|
||||
secrets: inherit
|
||||
|
||||
@@ -31,15 +31,14 @@ jobs:
|
||||
|
||||
- name: Terraform init
|
||||
run: |
|
||||
terraform -chdir=./infrastructure init -input=false
|
||||
terraform -chdir=./infrastructure init -reconfigure -backend-config="./backend/${{ inputs.environment_name }}.backend.tfvars" -input=false
|
||||
|
||||
- name: Terraform plan
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
run: |
|
||||
terraform -chdir=./infrastructure plan -no-color -input=false
|
||||
|
||||
- name: Terraform apply
|
||||
if: ${{ github.event_name != 'pull_request' }}
|
||||
run: |
|
||||
terraform -chdir=./infrastructure apply -no-color -input=false
|
||||
# - name: Terraform apply
|
||||
# if: ${{ github.event_name != 'pull_request' }}
|
||||
# run: |
|
||||
# terraform -chdir=./infrastructure apply -no-color -input=false
|
||||
|
||||
1
infrastructure/backend/prod.backend.tfvars
Normal file
1
infrastructure/backend/prod.backend.tfvars
Normal file
@@ -0,0 +1 @@
|
||||
container_name = "tfstate-flying-prod"
|
||||
1
infrastructure/backend/test.backend.tfvars
Normal file
1
infrastructure/backend/test.backend.tfvars
Normal file
@@ -0,0 +1 @@
|
||||
container_name = "tfstate-flying-test"
|
||||
@@ -16,12 +16,9 @@ terraform {
|
||||
}
|
||||
}
|
||||
|
||||
backend "remote" {
|
||||
hostname = "app.terraform.io"
|
||||
organization = "noahspan"
|
||||
|
||||
workspaces {
|
||||
prefix = "noahspan-"
|
||||
}
|
||||
backend "azurerm" {
|
||||
resource_group_name = "noahspan"
|
||||
storage_account_name = "noahspanterraform"
|
||||
key = "terraform.tfstate"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user