Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions .github/workflows/continuous_delivery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@ name: Continuous Delivery

on:
workflow_run:
workflows: ["Continous Delivery (Infrastructure)", "Continuous Integration"]
workflows: ["Continuous Integration", "Continous Delivery (Infrastructure)"]
types:
- completed
workflow_dispatch:

jobs:
release:
if: |
github.event.workflow_run.conclusion == 'success'
&& github.event.workflow_run.head_branch == 'main'
github.event.workflow_run.conclusion == 'success' &&
contains(fromJson('["Continuous Integration", "Continous Delivery (Infrastructure)"]'), github.event.workflow_run.name) &&
github.event.workflow_run.event == 'push'
name: Create GitHub Release
runs-on: ubuntu-24.04
concurrency: release
Expand All @@ -36,8 +37,9 @@ jobs:
runs-on: ubuntu-24.04
needs: release
if: |
github.event.workflow_run.conclusion == 'success'
&& github.event.workflow_run.head_branch == 'main'
github.event.workflow_run.conclusion == 'success' &&
contains(fromJson('["Continuous Integration", "Continous Delivery (Infrastructure)"]'), github.event.workflow_run.name) &&
github.event.workflow_run.event == 'push'

steps:
- name: Checkout code
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update_infrastructure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ jobs:
- name: Setup terraform.tfvars
run: |
cat <<EOF > terraform.tfvars
db_password = "${{ secrets.DB_PASSWORD }}"
project_id = "${{ secrets.TF_PROJECT_ID }}"
terraform_sa_email = "${{ secrets.TF_SA_EMAIL }}"

cloud_run_env_vars = {
DATABASE_URL = "${{ secrets.DATABASE_URL }}"
ENV = "production"
OPENAI_API_KEY = "${{ secrets.OPENAI_API_KEY_PROD }}"
}
Expand Down
3 changes: 1 addition & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,5 @@
"username": "postgres",
"password": "password"
}
],
"windsurfPyright.disableLanguageServices": true
]
}
13 changes: 0 additions & 13 deletions terraform/cloud_run.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@ resource "google_cloud_run_service" "fastapi" {
location = var.region
project = var.project_id

metadata {
annotations = {
"run.googleapis.com/cloudsql-instances" = google_sql_database_instance.sql_instance_sightcall_qa_api.connection_name
"run.googleapis.com/vpc-access-connector" = google_vpc_access_connector.serverless_connector.id
"run.googleapis.com/vpc-access-egress" = "all-traffic"
}
}

template {
spec {
service_account_name = google_service_account.cloudrun_sa.email
Expand All @@ -34,11 +26,6 @@ resource "google_cloud_run_service" "fastapi" {
value = env.value
}
}

env {
name = "DATABASE_URL"
value = local.database_url
}
}
}

Expand Down
32 changes: 0 additions & 32 deletions terraform/database.tf

This file was deleted.

9 changes: 0 additions & 9 deletions terraform/locals.tf

This file was deleted.

2 changes: 1 addition & 1 deletion terraform/terraform.tfvars.example
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
db_password = "password"
project_id = "sightcall-qa-api"
terraform_sa_email = "terraform@example.iam.gserviceaccount.com"

cloud_run_env_vars = {
DATABASE_URL = "postgresql://postgres:password@vector_db:5432/vectordb"
ENV = "production"
OPENAI_API_KEY = "sk-"
}
9 changes: 1 addition & 8 deletions terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ variable "cloud_run_env_vars" {
default = {}
}

variable "db_password" {
type = string
description = "Password for the database"
sensitive = true
}

variable "enabled_apis" {
type = list(string)
default = [
Expand All @@ -26,8 +20,7 @@ variable "enabled_apis" {
"iam.googleapis.com",
"serviceusage.googleapis.com",
"logging.googleapis.com",
"monitoring.googleapis.com",
"vpcaccess.googleapis.com"
"monitoring.googleapis.com"
]
}

Expand Down
22 changes: 0 additions & 22 deletions terraform/vpc.tf

This file was deleted.