From a3d873576456f9203ef484e691c7edbb14fde146 Mon Sep 17 00:00:00 2001 From: Daniel Baptista Dias Date: Thu, 7 Mar 2024 10:18:14 -0300 Subject: [PATCH] chore(ci): simplify release CI steps (#3708) --- .github/workflows/deploy-demo.yml | 122 ------------------ .github/workflows/deploy-main.yml | 83 ------------ .github/workflows/release-candidate.yml | 8 -- .github/workflows/release-version.yml | 8 -- .../update-dependency-deployments.yml | 33 ----- 5 files changed, 254 deletions(-) delete mode 100644 .github/workflows/deploy-demo.yml delete mode 100644 .github/workflows/update-dependency-deployments.yml diff --git a/.github/workflows/deploy-demo.yml b/.github/workflows/deploy-demo.yml deleted file mode 100644 index 580418e593..0000000000 --- a/.github/workflows/deploy-demo.yml +++ /dev/null @@ -1,122 +0,0 @@ -name: Release Tracetest Demo - -permissions: - contents: write - -concurrency: - group: "release-demo" - cancel-in-progress: true - -defaults: - run: - shell: bash - -on: - push: - tags: - # this pipeline is only for final releases - - "v[0-9]+.[0-9]+.[0-9]+" -jobs: - build-web: - name: build web - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Setup node - uses: actions/setup-node@v3 - with: - node-version: 16 - cache: npm - cache-dependency-path: web/package-lock.json - - name: Cache Build - id: cache-build - uses: actions/cache@v3 - with: - path: web/build/ - key: web-build-${{ hashFiles('web/*') }} - - run: cd web; npm ci - if: steps.cache-build.outputs.cache-hit != 'true' - - run: cd web; CI= npm run build - if: steps.cache-build.outputs.cache-hit != 'true' - - name: Upload assets - uses: actions/upload-artifact@v3 - with: - name: tracetest-web - path: web/build/ - - demo-release: - runs-on: ubuntu-latest - needs: [build-web] - env: - DOCKER_CLI_EXPERIMENTAL: "enabled" - GORELEASER_KEY: ${{ secrets.GORELEASER_LICENSE }} - GITHUB_TOKEN: ${{ secrets.CI_BOT_TOKEN }} - FURY_TOKEN: ${{ secrets.FURY_TOKEN }} - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - uses: docker/setup-qemu-action@v2 - - uses: docker/setup-buildx-action@v2 - - name: Login to DockerHub - uses: docker/login-action@v2 - if: github.event_name != 'pull_request' - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Setup go - uses: actions/setup-go@v3 - with: - go-version-file: 'go.mod' - cache: true - cache-dependency-path: go.mod - - uses: actions/download-artifact@v3 - with: - name: tracetest-web - path: web/build/ - # release - - uses: goreleaser/goreleaser-action@v4 - with: - distribution: goreleaser-pro - version: v1.23.0 - args: release --clean --skip=announce -f .goreleaser.demo.yaml - env: - VERSION: ${{ github.ref_name}}-demo - TRACETEST_ENV: demo - ANALYTICS_FE_KEY: ${{ secrets.ANALYTICS_FE_KEY }} - ANALYTICS_BE_KEY: ${{ secrets.ANALYTICS_BE_KEY }} - TRACETEST_DEFAULT_CLOUD_ENDPOINT: ${{ secrets.TRACETEST_DEFAULT_CLOUD_ENDPOINT }} - - demo-deploy: - if: github.event_name == 'push' - needs: [demo-release] - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - uses: google-github-actions/setup-gcloud@94337306dda8180d967a56932ceb4ddcf01edae7 - with: - service_account_key: ${{ secrets.GKE_SA_KEY }} - project_id: ${{ secrets.GKE_PROJECT }} - - - run: |- - gcloud --quiet auth configure-docker - - - uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e - with: - cluster_name: ${{ secrets.GKE_CLUSTER }} - location: ${{ secrets.GKE_ZONE }} - credentials: ${{ secrets.GKE_SA_KEY }} - - - name: Deploy - run: | - TAG=${{ github.ref_name}}-demo \ - NAME=tracetest-demo \ - CONFIG_FILE=./k8s/tracetest.demo.yaml \ - EXPOSE_HOST=demo.tracetest.io \ - CERT_NAME=tracetest-demo \ - BACKEND_CONFIG=tracetest-demo \ - ./k8s/deploy.sh diff --git a/.github/workflows/deploy-main.yml b/.github/workflows/deploy-main.yml index d6192f6965..558cc7b9dd 100644 --- a/.github/workflows/deploy-main.yml +++ b/.github/workflows/deploy-main.yml @@ -15,39 +15,6 @@ on: workflow_dispatch: jobs: - # backend-arch-graph: - # name: Generate backend architecture graph - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v3 - # with: - # fetch-depth: 0 - # - name: Setup go - # uses: actions/setup-go@v3 - # with: - # go-version-file: 'go.mod' - # cache: true - # cache-dependency-path: go.mod - # - name: install graph tool - # run: | - # mkdir /tmp/go-arch - # cd /tmp/go-arch - # curl -SLO https://github.com/mathnogueira/golang-arch-viewer/archive/refs/heads/master.zip - # unzip master.zip - # cd golang-arch-viewer-master - # make - # mv dist/go-arch /tmp/go-arch/go-arch - # - name: generate graph - # run: | - # cd server - # mkdir -p ../dist/ - # /tmp/go-arch/go-arch -o ../dist/architecture.png - # - name: Upload assets - # uses: actions/upload-artifact@v3 - # with: - # name: architecture-graph - # path: dist/architecture.png - build-web: name: build web runs-on: ubuntu-latest @@ -181,10 +148,6 @@ jobs: with: name: tracetest-web path: web/build/ - # - uses: actions/download-artifact@v3 - # with: - # name: architecture-graph - # path: dist/architecture.png - uses: goreleaser/goreleaser-action@v4 if: steps.cache.outputs.cache-hit != 'true' @@ -198,49 +161,3 @@ jobs: ANALYTICS_FE_KEY: ${{ secrets.ANALYTICS_FE_KEY }} ANALYTICS_BE_KEY: ${{ secrets.ANALYTICS_BE_KEY }} TRACETEST_DEFAULT_CLOUD_ENDPOINT: ${{ secrets.TRACETEST_DEFAULT_CLOUD_ENDPOINT }} - - deploy-beta: - if: github.event_name == 'push' - needs: release - name: Deploy Beta - runs-on: ubuntu-latest - - steps: - - 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 }} - project_id: ${{ secrets.GKE_PROJECT }} - - - run: |- - gcloud --quiet auth configure-docker - - - uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e - with: - cluster_name: ${{ secrets.GKE_CLUSTER }} - location: ${{ secrets.GKE_ZONE }} - credentials: ${{ secrets.GKE_SA_KEY }} - - - name: Deploy - run: | - TAG=${{env.TAG}} \ - NAME=tracetest-beta \ - CONFIG_FILE=./k8s/tracetest.beta.yaml \ - EXPOSE_HOST=beta.tracetest.io \ - CERT_NAME=tracetest-beta \ - 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 3f8e5a938e..909a96c820 100644 --- a/.github/workflows/release-candidate.yml +++ b/.github/workflows/release-candidate.yml @@ -103,12 +103,4 @@ 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 76f8f42b37..cf860dfab3 100644 --- a/.github/workflows/release-version.yml +++ b/.github/workflows/release-version.yml @@ -102,14 +102,6 @@ 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" diff --git a/.github/workflows/update-dependency-deployments.yml b/.github/workflows/update-dependency-deployments.yml deleted file mode 100644 index 638960bc8b..0000000000 --- a/.github/workflows/update-dependency-deployments.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Update dependency deployments - -on: - push: - branches: - - main - paths: - - k8s/** - -jobs: - deploy-collector: - name: Deploy OTEL Collector - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - uses: google-github-actions/setup-gcloud@94337306dda8180d967a56932ceb4ddcf01edae7 - with: - service_account_key: ${{ secrets.GKE_SA_KEY }} - project_id: ${{ secrets.GKE_PROJECT }} - - - uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e - with: - cluster_name: ${{ secrets.GKE_CLUSTER }} - location: ${{ secrets.GKE_ZONE }} - credentials: ${{ secrets.GKE_SA_KEY }} - - - name: Apply - run: | - ./k8s/deploy-collector.sh - env: - LIGHTSTEP_TOKEN: ${{ secrets.LIGHTSTEP_TOKEN }}