Merge pull request #9 from tribofustack/feat/sonarqube #33
This file contains 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: Apply | |
on: | |
push: | |
branches: [main] | |
workflow_dispatch: | |
jobs: | |
terraform_apply: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Auth GCloud | |
uses: 'google-github-actions/auth@v2.1.2' | |
with: | |
credentials_json: ${{ secrets.CREDENTIALS }} | |
create_credentials_file: true | |
- name: Setup GCloud | |
uses: "google-github-actions/setup-gcloud@v1" | |
- name: Setup Terraform | |
uses: hashicorp/setup-terraform@v3 | |
- name: terraform init | |
run: terraform init -backend-config="bucket=${{ vars.BUCKET_NAME }}" -upgrade | |
- name: terraform validate | |
run: terraform validate | |
- name: terraform apply | |
run: terraform apply -auto-approve -var="project_id=${{ vars.PROJECT_ID }}" -var="region=${{ vars.REGION }}" -var="zone=${{ vars.ZONE }}" -var="cluster_name=${{ vars.CLUSTER_NAME }}" -var="instance_db_name=${{ vars.DB_INSTANCE_NAME }}" -var="db_name=${{ vars.DB_NAME }}" -var="db_username=${{ vars.DB_USERNAME }}" -var="db_pass=${{ secrets.DB_PASSWORD }}" | |
- name: db connection | |
run: terraform output db_info |