fix: move import blocks to root module (required by Terraform) #32
This file contains hidden or 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: Deploy Auth Proxy | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "deploy/auth-proxy/**" | |
| - "deploy/terraform/modules/auth-proxy/**" | |
| workflow_dispatch: {} | |
| permissions: | |
| contents: read | |
| actions: write | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| name: Deploy via Terraform | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: hashicorp/setup-terraform@v3 | |
| - name: Build function source | |
| working-directory: deploy/auth-proxy | |
| run: | | |
| npm ci | |
| npm run build | |
| - name: Authenticate to GCP | |
| uses: google-github-actions/auth@v2 | |
| with: | |
| credentials_json: ${{ secrets.GCP_SA_KEY }} | |
| - name: Detect GCP project from service account key | |
| id: gcp | |
| run: | | |
| PROJECT_ID=$(echo '${{ secrets.GCP_SA_KEY }}' | jq -r .project_id) | |
| echo "project_id=$PROJECT_ID" >> $GITHUB_OUTPUT | |
| echo "tf_state_bucket=${PROJECT_ID}-terraform-state" >> $GITHUB_OUTPUT | |
| - name: Terraform Init | |
| working-directory: deploy/terraform | |
| run: terraform init -backend-config="bucket=${{ steps.gcp.outputs.tf_state_bucket }}" -backend-config="prefix=haiku" | |
| - name: Clear stale Terraform lock | |
| run: gcloud storage rm "gs://${{ steps.gcp.outputs.tf_state_bucket }}/haiku/default.tflock" 2>/dev/null || true | |
| - name: Terraform Apply | |
| id: terraform | |
| working-directory: deploy/terraform | |
| run: | | |
| terraform apply -auto-approve | |
| echo "auth_proxy_url=$(terraform output -raw auth_proxy_url)" >> $GITHUB_OUTPUT | |
| env: | |
| TF_VAR_gcp_project_id: ${{ steps.gcp.outputs.project_id }} | |
| TF_VAR_domain: ${{ vars.HAIKU_DOMAIN || 'haikumethod.ai' }} | |
| TF_VAR_enable_auth_proxy: "true" | |
| TF_VAR_auth_proxy_subdomain: ${{ vars.TF_VAR_auth_proxy_subdomain || 'auth' }} | |
| TF_VAR_auth_proxy_allowed_origin: ${{ vars.HAIKU_AUTH_ALLOWED_ORIGIN || 'https://haikumethod.ai' }} | |
| TF_VAR_github_oauth_client_id: ${{ vars.NEXT_PUBLIC_HAIKU_GITHUB_OAUTH_CLIENT_ID }} | |
| TF_VAR_github_oauth_client_secret: ${{ secrets.HAIKU_GITHUB_OAUTH_CLIENT_SECRET }} | |
| TF_VAR_gitlab_oauth_client_id: ${{ vars.NEXT_PUBLIC_HAIKU_GITLAB_OAUTH_CLIENT_ID }} | |
| TF_VAR_gitlab_oauth_client_secret: ${{ secrets.HAIKU_GITLAB_OAUTH_CLIENT_SECRET }} | |
| TF_VAR_enable_mcp_dns: "false" | |
| - name: Print auth proxy URL | |
| run: echo "Auth proxy deployed at ${{ steps.terraform.outputs.auth_proxy_url }}" |