mirror of
https://github.com/multipleof4/git.planetrenox.com.git
synced 2026-01-13 16:07:55 +00:00
Update deploy.yml
This commit is contained in:
17
.github/workflows/deploy.yml
vendored
17
.github/workflows/deploy.yml
vendored
@@ -8,30 +8,27 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Extract project_id
|
- name: Extract project_id
|
||||||
id: pj
|
id: pj
|
||||||
run: echo "pid=$(jq -r .project_id <<< '${{ secrets.GCP_SA_KEY_JSON }}')" >> $GITHUB_OUTPUT
|
run: echo "pid=$(jq -r .project_id <<< '${{ secrets.GCP_SA_KEY_JSON }}')" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- uses: google-github-actions/auth@v2
|
- uses: google-github-actions/auth@v2
|
||||||
with:
|
with:
|
||||||
credentials_json: ${{ secrets.GCP_SA_KEY_JSON }}
|
credentials_json: ${{ secrets.GCP_SA_KEY_JSON }}
|
||||||
|
|
||||||
- uses: hashicorp/setup-terraform@v3
|
- uses: hashicorp/setup-terraform@v3
|
||||||
|
|
||||||
- name: Terraform Init
|
- name: Terraform Init
|
||||||
working-directory: terraform
|
working-directory: terraform
|
||||||
run: terraform init
|
env:
|
||||||
|
TF_VAR_project_id: ${{ steps.pj.outputs.pid }}
|
||||||
|
run: terraform init -input=false
|
||||||
- name: Terraform Import firewall if exists
|
- name: Terraform Import firewall if exists
|
||||||
working-directory: terraform
|
working-directory: terraform
|
||||||
|
env:
|
||||||
|
TF_VAR_project_id: ${{ steps.pj.outputs.pid }}
|
||||||
run: |
|
run: |
|
||||||
set +e
|
set +e
|
||||||
terraform import google_compute_firewall.gitea_allow projects/${{ steps.pj.outputs.pid }}/global/firewalls/allow-gitea-3000-ssh
|
terraform import -input=false google_compute_firewall.gitea_allow projects/${{ steps.pj.outputs.pid }}/global/firewalls/allow-gitea-3000-ssh >/dev/null 2>&1 || true
|
||||||
set -e || true
|
|
||||||
|
|
||||||
- name: Terraform Apply
|
- name: Terraform Apply
|
||||||
working-directory: terraform
|
working-directory: terraform
|
||||||
env:
|
env:
|
||||||
TF_VAR_project_id: ${{ steps.pj.outputs.pid }}
|
TF_VAR_project_id: ${{ steps.pj.outputs.pid }}
|
||||||
run: terraform apply -auto-approve
|
run: terraform apply -auto-approve -input=false
|
||||||
|
|||||||
Reference in New Issue
Block a user