From 72fac6a60e3cb236f1d7e2bcb0318a866540f011 Mon Sep 17 00:00:00 2001 From: Vitaliy Potyarkin Date: Wed, 18 Dec 2024 14:06:56 +0300 Subject: [PATCH] [#587] Build OCI images for release tags OCI images will be built often (on each PR) to make sure our recipe doesn't get rusty. Publishing to the registry will happen only for `v*` tags. Signed-off-by: Vitaliy Potyarkin --- .forgejo/workflows/builds.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.forgejo/workflows/builds.yml b/.forgejo/workflows/builds.yml index 7c2bb04..a993811 100644 --- a/.forgejo/workflows/builds.yml +++ b/.forgejo/workflows/builds.yml @@ -3,6 +3,9 @@ on: push: branches: - master + tags: + - v* + workflow_dispatch: jobs: builds: @@ -25,3 +28,27 @@ jobs: - name: Check dirty suffix run: if [[ $(make version) == *"dirty"* ]]; then echo "Version has dirty suffix" && exit 1; fi + + image: + name: OCI image + needs: + - builds + runs-on: docker + container: git.frostfs.info/truecloudlab/env:oci-image-builder-bookworm + steps: + - name: Clone git repo + uses: actions/checkout@v3 + + - name: Build OCI image + run: make image + + - name: Push image to OCI registry + run: | + echo "$REGISTRY_PASSWORD" \ + | docker login --username truecloudlab --password-stdin git.frostfs.info + make image-push + if: >- + startsWith(github.ref, 'refs/tags/v') && + (github.event_name == 'workflow_dispatch' || github.event_name == 'push') + env: + REGISTRY_PASSWORD: ${{secrets.REGISTRY_PASSWORD}}