From a4778d29bebaa76633d05a39f9d71d41e4477c24 Mon Sep 17 00:00:00 2001 From: noahspannbauer Date: Mon, 13 Jul 2026 11:08:25 -0500 Subject: [PATCH] adding infisical action to workflows --- .gitea/workflows/changes.yaml | 4 +++- .gitea/workflows/main.yaml | 2 +- .gitea/workflows/pull_request.yaml | 10 ++++++++++ .gitea/workflows/tag.yaml | 6 +++--- .../{infrastructure.yaml => terraform.yaml} | 16 +++++++++------- 5 files changed, 26 insertions(+), 12 deletions(-) rename .gitea/workflows/{infrastructure.yaml => terraform.yaml} (68%) diff --git a/.gitea/workflows/changes.yaml b/.gitea/workflows/changes.yaml index 0db98fb..5809052 100644 --- a/.gitea/workflows/changes.yaml +++ b/.gitea/workflows/changes.yaml @@ -33,4 +33,6 @@ jobs: api: - 'api/**' client: - - 'client/**' \ No newline at end of file + - 'client/**' + infrastructure: + - 'infrastructure/**' \ No newline at end of file diff --git a/.gitea/workflows/main.yaml b/.gitea/workflows/main.yaml index dcee579..7523f32 100644 --- a/.gitea/workflows/main.yaml +++ b/.gitea/workflows/main.yaml @@ -23,7 +23,7 @@ jobs: name: deploy needs: - changes - - build + - build-and-test uses: ./.gitea/workflows/deploy.yaml with: app_name: flying diff --git a/.gitea/workflows/pull_request.yaml b/.gitea/workflows/pull_request.yaml index 2bed9a6..d4f26aa 100644 --- a/.gitea/workflows/pull_request.yaml +++ b/.gitea/workflows/pull_request.yaml @@ -17,3 +17,13 @@ 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 diff --git a/.gitea/workflows/tag.yaml b/.gitea/workflows/tag.yaml index a4356bc..aac6e22 100644 --- a/.gitea/workflows/tag.yaml +++ b/.gitea/workflows/tag.yaml @@ -5,8 +5,8 @@ on: - '**' jobs: - build: - name: build + build-and-test: + name: build-and-test uses: ./.gitea/workflows/build_and_test.yaml with: environment_name: prod @@ -16,7 +16,7 @@ jobs: deploy: name: deploy needs: - - build + - build-and-test uses: ./.gitea/workflows/deploy.yaml with: app_name: flying diff --git a/.gitea/workflows/infrastructure.yaml b/.gitea/workflows/terraform.yaml similarity index 68% rename from .gitea/workflows/infrastructure.yaml rename to .gitea/workflows/terraform.yaml index 3cb2e24..d82fcb8 100644 --- a/.gitea/workflows/infrastructure.yaml +++ b/.gitea/workflows/terraform.yaml @@ -1,4 +1,4 @@ -name: 'Infrastructure' +name: 'Terraform' on: workflow_dispatch: inputs: @@ -6,7 +6,7 @@ on: type: string jobs: - infrastructure: + terraform: runs-on: ubuntu-latest environment: steps: @@ -31,13 +31,15 @@ jobs: - name: Terraform init run: | - terraform init -input=false + terraform -chdir=./infrastructure init -input=false - name: Terraform plan + if: ${{ github.event_name == 'pull_request' }} run: | - terraform -chdir=/infrastructure plan -no-color -input=false + terraform -chdir=./infrastructure plan -no-color -input=false - # - name: Terraform apply - # run: | - # terraform apply -no-color - + - name: Terraform apply + if: ${{ github.event_name != 'pull_request' }} + run: | + terraform -chdir=./infrastructure apply -no-color -input=false \ No newline at end of file -- 2.49.1