From ce2ac34ad4256a4a579f90950d7fd7d78dcd80f7 Mon Sep 17 00:00:00 2001 From: Sebastian Choren Date: Wed, 7 Feb 2024 12:14:51 -0300 Subject: [PATCH] chore(infra): enable auto update (#3598) * chore(infra): enable auto update * hide repo --- .github/workflows/deploy-main.yml | 13 ++++++++++++- .github/workflows/release-candidate.yml | 9 +++++++++ .github/workflows/release-version.yml | 8 ++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-main.yml b/.github/workflows/deploy-main.yml index 5aa8884577..d6192f6965 100644 --- a/.github/workflows/deploy-main.yml +++ b/.github/workflows/deploy-main.yml @@ -209,6 +209,10 @@ jobs: - name: Checkout uses: actions/checkout@v3 + - shell: bash + run: | + echo "TAG=sha-$(git rev-parse --short=8 $GITHUB_SHA)" >> $GITHUB_ENV + - uses: google-github-actions/setup-gcloud@94337306dda8180d967a56932ceb4ddcf01edae7 with: service_account_key: ${{ secrets.GKE_SA_KEY }} @@ -225,7 +229,7 @@ jobs: - name: Deploy run: | - TAG=sha-$(git rev-parse --short=8 $GITHUB_SHA) \ + TAG=${{env.TAG}} \ NAME=tracetest-beta \ CONFIG_FILE=./k8s/tracetest.beta.yaml \ EXPOSE_HOST=beta.tracetest.io \ @@ -233,3 +237,10 @@ jobs: BACKEND_CONFIG=tracetest-beta \ ./k8s/deploy.sh + - name: Trigger Infra Update + uses: peter-evans/repository-dispatch@v1 + with: + token: ${{ secrets.INFRA_REPO_PAT }} + repository: ${{ secrets.INFRA_REPO }} + event-type: update-tags + client-payload: '{"repo_name": "tracetest", "new_tag": "${{ env.TAG }}"}' diff --git a/.github/workflows/release-candidate.yml b/.github/workflows/release-candidate.yml index e52e35b81b..3f8e5a938e 100644 --- a/.github/workflows/release-candidate.yml +++ b/.github/workflows/release-candidate.yml @@ -103,3 +103,12 @@ jobs: env: VERSION: ${{ github.ref_name }} + - name: Trigger Infra Update + uses: peter-evans/repository-dispatch@v1 + with: + token: ${{ secrets.INFRA_REPO_PAT }} + repository: ${{ secrets.INFRA_REPO }} + event-type: update-tags + client-payload: '{"repo_name": "tracetest", "new_tag": "${{ github.ref_name}}"}' + + diff --git a/.github/workflows/release-version.yml b/.github/workflows/release-version.yml index cf860dfab3..76f8f42b37 100644 --- a/.github/workflows/release-version.yml +++ b/.github/workflows/release-version.yml @@ -102,6 +102,14 @@ jobs: ANALYTICS_BE_KEY: ${{ secrets.ANALYTICS_BE_KEY }} TRACETEST_DEFAULT_CLOUD_ENDPOINT: ${{ secrets.TRACETEST_DEFAULT_CLOUD_ENDPOINT }} + - name: Trigger Infra Update + uses: peter-evans/repository-dispatch@v1 + with: + token: ${{ secrets.INFRA_REPO_PAT }} + repository: ${{ secrets.INFRA_REPO }} + event-type: update-tags + client-payload: '{"repo_name": "tracetest", "new_tag": "${{ github.ref_name}}"}' + helm_chart_version_bump: name: "Trigger Helm chart appVersion update" needs: "release"