From 4358a5da7c98a919cd807963960b85e0c6ff09cb Mon Sep 17 00:00:00 2001 From: Bastian Krol Date: Thu, 1 Feb 2024 15:10:50 +0100 Subject: [PATCH] [dash0] deploy new releases automatically --- .github/actions/deploy-demo/action.yaml | 34 +++++++++++++++++++++++++ .github/workflows/release.yml | 16 +++++++++++- .licenserc.json | 3 ++- 3 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 .github/actions/deploy-demo/action.yaml diff --git a/.github/actions/deploy-demo/action.yaml b/.github/actions/deploy-demo/action.yaml new file mode 100644 index 0000000000..b839298b81 --- /dev/null +++ b/.github/actions/deploy-demo/action.yaml @@ -0,0 +1,34 @@ +# Copyright 2024 Dash0 Inc. +# SPDX-License-Identifier: Apache-2.0 +name: Deploy Dash0 OTel Demo +description: deploy a release of the Dash0 fork of the OpenTelemetry demo +inputs: + token: + description: 'read/write Github access token for thr dash0-configuration repository' + required: true + containerImageVersion: + description: 'version tag of the Dash0 OTel Demo container images, e.g. 1.1.0' + required: true +runs: + using: "composite" + steps: + - name: checkout dash0-configuration + uses: actions/checkout@v4 + with: + repository: dash0hq/dash0-configuration + token: ${{ inputs.token }} + path: dash0-configuration + + - name: update container image version + uses: mikefarah/yq@v4.35.2 + with: + cmd: yq -i '.otelDemo.helm.default.image.tag="${{ inputs.containerImageVersion }}"' dash0-configuration/demo/environments/aws/demo-eu-west-1-demo.yaml + - name: git push dash0-configuration + shell: bash + run: | + cd dash0-configuration + git add demo/environments/aws/demo-eu-west-1-demo.yaml + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git commit -am "chore(otel-demo): update otel-demo image version to ${{ inputs.containerImageVersion }}" + git push diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 54a6e1367c..be432d26a0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,6 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 -name: "Publish Images" +name: "Publish Images & Deploy" on: release: @@ -13,3 +13,17 @@ jobs: push: true version: ${{ github.event.release.tag_name }} secrets: inherit + + deploy_release: + name: deploy to https://otel-demo.eu-west-1.aws.dash0-demo.com/ + needs: + - build_and_push_images + runs-on: ubuntu-latest + # do not run multiple deployment jobs concurrently + concurrency: deploy + steps: + - name: deploy release + uses: .github/actions/deploy-demo + with: + token: ${{ secrets.REPOSITORY_FULL_ACCESS_GITHUB_TOKEN }} + containerImageVersion: ${{ github.event.release.tag_name }} diff --git a/.licenserc.json b/.licenserc.json index 6a46440441..4d3095fd9b 100644 --- a/.licenserc.json +++ b/.licenserc.json @@ -45,6 +45,7 @@ "src/featureflagservice/assets/vendor/", "src/featureflagservice/priv/", "src/productcatalogservice/genproto/", - "internal/tools/" + "internal/tools/", + ".github/actions/deploy-demo/action.yaml" ] } \ No newline at end of file