From 02fb273a45839179724a97243bb481c89d6debf5 Mon Sep 17 00:00:00 2001 From: anaik91 Date: Sat, 28 Oct 2023 01:05:46 +0530 Subject: [PATCH] feat: updated github actions to deploy control plane --- .github/workflows/testing.yml | 42 +++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 71a152f..97d1689 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -43,3 +43,45 @@ jobs: tags: | ${{ secrets.GCP_REGION }}-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/${{ secrets.GCP_GAR_REPO }}/ansible-helm-apigee-hybrid-deployer:${{ steps.commit.outputs.short }} ${{ secrets.GCP_REGION }}-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/${{ secrets.GCP_GAR_REPO }}/ansible-helm-apigee-hybrid-deployer:latest + + deploy-control-plane: + name: Deploy Apigee Hybrid Control Plane + runs-on: ubuntu-latest + if: github.event_name == 'push' + permissions: + contents: 'read' + id-token: 'write' + + steps: + - id: checkout + name: Checkout + uses: actions/checkout@v2 + + - id: commit + uses: prompt/actions-commit-hash@v3 + + - id: auth + name: Authenticate with Google Cloud + uses: google-github-actions/auth@v0 + with: + token_format: access_token + workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_POOL_PROVIDER_NAME }} + service_account: ${{ secrets.SVC_ACCOUNT_EMAIL }} + access_token_lifetime: 300s + + - name: Setup Terraform + uses: hashicorp/setup-terraform@v2 + with: + terraform_version: 1.5.2 + terraform_wrapper: false + + - name: Run Terraform + id: init + run: | + bash deploy_control_plane.sh ${{ github.workspace }}/test/terraform/control-plane + shell: bash + working-directory: ./test/scipts + env: + TF_BACKEND_BUCKET: ${{ secrets.TF_BACKEND_BUCKET }} + GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }} + GCP_REGION: ${{ secrets.GCP_REGION }} \ No newline at end of file