Compare commits
12 Commits
755c429d04
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 7d88890c3c | |||
| a54105e8e5 | |||
| b8ec5be269 | |||
| 875b8a0d90 | |||
| 81c589001b | |||
| baedfc1675 | |||
| 4eccf8e83c | |||
| a4778d29be | |||
| 5c04870d37 | |||
| c81b514ae8 | |||
| 5a07318527 | |||
| 99e5d162ef |
@@ -33,4 +33,6 @@ jobs:
|
|||||||
api:
|
api:
|
||||||
- 'api/**'
|
- 'api/**'
|
||||||
client:
|
client:
|
||||||
- 'client/**'
|
- 'client/**'
|
||||||
|
infrastructure:
|
||||||
|
- 'infrastructure/**'
|
||||||
@@ -23,7 +23,7 @@ jobs:
|
|||||||
name: deploy
|
name: deploy
|
||||||
needs:
|
needs:
|
||||||
- changes
|
- changes
|
||||||
- build
|
- build-and-test
|
||||||
uses: ./.gitea/workflows/deploy.yaml
|
uses: ./.gitea/workflows/deploy.yaml
|
||||||
with:
|
with:
|
||||||
app_name: flying
|
app_name: flying
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ on:
|
|||||||
- '**'
|
- '**'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build-and-test:
|
||||||
name: build
|
name: build-and-test
|
||||||
uses: ./.gitea/workflows/build_and_test.yaml
|
uses: ./.gitea/workflows/build_and_test.yaml
|
||||||
with:
|
with:
|
||||||
environment_name: prod
|
environment_name: prod
|
||||||
@@ -16,7 +16,7 @@ jobs:
|
|||||||
deploy:
|
deploy:
|
||||||
name: deploy
|
name: deploy
|
||||||
needs:
|
needs:
|
||||||
- build
|
- build-and-test
|
||||||
uses: ./.gitea/workflows/deploy.yaml
|
uses: ./.gitea/workflows/deploy.yaml
|
||||||
with:
|
with:
|
||||||
app_name: flying
|
app_name: flying
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
name: 'Infrastructure'
|
name: 'Terraform'
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
@@ -6,7 +6,7 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
infrastructure:
|
terraform:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
environment:
|
environment:
|
||||||
steps:
|
steps:
|
||||||
@@ -31,13 +31,14 @@ jobs:
|
|||||||
|
|
||||||
- name: Terraform init
|
- name: Terraform init
|
||||||
run: |
|
run: |
|
||||||
terraform init -input=false
|
terraform -chdir=./infrastructure init -reconfigure -backend-config="./backend/${{ inputs.environment_name }}.backend.tfvars" -input=false
|
||||||
|
|
||||||
- name: Terraform plan
|
- name: Terraform plan
|
||||||
run: |
|
run: |
|
||||||
terraform plan -no-color -input=false
|
terraform -chdir=./infrastructure plan -no-color -input=false
|
||||||
|
|
||||||
- name: Terraform apply
|
# - name: Terraform apply
|
||||||
run: |
|
# if: ${{ github.event_name != 'pull_request' }}
|
||||||
terraform apply -no-color -
|
# 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" {
|
backend "azurerm" {
|
||||||
hostname = "app.terraform.io"
|
resource_group_name = "noahspan"
|
||||||
organization = "noahspan"
|
storage_account_name = "noahspanterraform"
|
||||||
|
key = "terraform.tfstate"
|
||||||
workspaces {
|
|
||||||
prefix = "noahspan-"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user