From 408653380730373a782325ffee55f4bb5d9fcc18 Mon Sep 17 00:00:00 2001 From: vokomarov Date: Sat, 19 Apr 2025 18:52:04 +0300 Subject: [PATCH] Fix base build, add Resource info --- .github/workflows/build-base.yml | 17 +++++++---------- .github/workflows/quality.yml | 3 ++- .github/workflows/release.yml | 7 +++++-- Dockerfile | 2 ++ 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-base.yml b/.github/workflows/build-base.yml index f9668369..2cb56000 100644 --- a/.github/workflows/build-base.yml +++ b/.github/workflows/build-base.yml @@ -1,12 +1,9 @@ name: build-base on: - workflow_dispatch: - inputs: - baseImageTag: - description: 'semver image tag (1.0.0)' - type: string - required: true + push: + tags: + - 'base/v*' env: REGISTRY: docker.io @@ -46,6 +43,9 @@ jobs: uses: docker/metadata-action@v5 with: images: ${{ env.REPO }} + tags: | + type=sha + type=semver,pattern={{version}} # Setup BuildX # https://github.com/docker/setup-buildx-action @@ -64,10 +64,7 @@ jobs: context: . push: ${{ github.event_name != 'pull_request' }} file: ./base.Dockerfile - tags: | - ${{ env.REPO }}:${{ github.sha }} - ${{ env.REPO }}:${{ inputs.baseImageTag }} - ${{ env.REPO }}:latest + tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=registry,ref=${{ env.REPO }}:latest cache-to: type=registry,ref=${{ env.REPO }}:latest,mode=max diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index fc334cae..fdac6ef8 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -87,7 +87,8 @@ jobs: tests: name: Tests - runs-on: [self-hosted, Linux, x64] +# runs-on: [self-hosted, Linux, x64] + runs-on: ubuntu-latest container: shivammathur/node:latest permissions: contents: read diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index aeb9a19b..7cb4daee 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,8 +2,11 @@ name: release on: workflow_dispatch: - release: - types: [ published ] + push: + tags: + - 'v*' + tags-ignore: + - 'base/v*' env: REGISTRY: docker.io diff --git a/Dockerfile b/Dockerfile index 25623152..df7f09e4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,6 +16,8 @@ ARG GIT_TAG ENV GIT_COMMIT=${GIT_COMMIT} ENV GIT_TAG=${GIT_TAG} ENV OTEL_SERVICE_VERSION=${GIT_TAG} +ENV OTEL_RESOURCE_ATTRIBUTES="service.instance.id=${OTEL_SERVICE_INSTANCE_ID},\ +service.version=${OTEL_SERVICE_VERSION}" WORKDIR /app