Skip to content

Commit

Permalink
feat: updated github actions to deploy control plane
Browse files Browse the repository at this point in the history
  • Loading branch information
anaik91 committed Oct 27, 2023
1 parent 0e17dbb commit 02fb273
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

0 comments on commit 02fb273

Please sign in to comment.