From 5a35cc5adcb9defacea56f3eef89446b6a365e17 Mon Sep 17 00:00:00 2001 From: multipleof4 Date: Thu, 11 Sep 2025 12:31:06 -0700 Subject: [PATCH] Update deploy.yml --- .github/workflows/deploy.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 3300604..132af32 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -8,16 +8,28 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Extract project_id id: pj run: echo "pid=$(jq -r .project_id <<< '${{ secrets.GCP_SA_KEY_JSON }}')" >> $GITHUB_OUTPUT + - uses: google-github-actions/auth@v2 with: credentials_json: ${{ secrets.GCP_SA_KEY_JSON }} + - uses: hashicorp/setup-terraform@v3 + - name: Terraform Init working-directory: terraform run: terraform init + + - name: Terraform Import firewall if exists + working-directory: terraform + run: | + set +e + terraform import google_compute_firewall.gitea_allow projects/${{ steps.pj.outputs.pid }}/global/firewalls/allow-gitea-3000-ssh + set -e || true + - name: Terraform Apply working-directory: terraform env: