From 3dffbf8389bc829ae380026dfe92a95c549c0ac4 Mon Sep 17 00:00:00 2001 From: ge0metrix Date: Mon, 12 Feb 2024 15:45:20 -0500 Subject: [PATCH] Update GitHub workflow to build docker images on RC commit Had to re-file this PR because workflows are run based on the workflow definition in the branch, not the main branch. --- .github/workflows/main.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index df491be3e..843b69e12 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,7 +4,9 @@ on: pull_request: branches: master push: - branches: master + branches: + - master + - rc/** tags: - v* release: @@ -23,14 +25,19 @@ jobs: name: Prepare id: prepare run: | - DOCKER_IMAGE=robotastic/trunk-recorder - GHCR_IMAGE=ghcr.io/robotastic/trunk-recorder + DOCKER_IMAGE=${GITHUB_REPOSITORY} + GHCR_IMAGE=ghcr.io/${GITHUB_REPOSITORY} DOCKER_PLATFORMS=linux/amd64,linux/arm64,linux/arm/v7 VERSION=edge if [[ $GITHUB_REF == refs/tags/* ]]; then VERSION=${GITHUB_REF#refs/tags/v} fi + echo GITHUB_REF_NAME=${GITHUB_REF_NAME} + echo GITHUB_REF_NAME_SLUG=${GITHUB_REF_NAME_SLUG} + if [[ $GITHUB_REF_NAME == rc/* ]]; then + VERSION=RC${GITHUB_REF_NAME#rc/v} + fi if [ "${{ github.event_name }}" = "schedule" ]; then VERSION=nightly fi @@ -45,7 +52,9 @@ jobs: TAGS="$TAGS --tag ${DOCKER_IMAGE}:latest" TAGS="$TAGS --tag ${GHCR_IMAGE}:latest" fi - + echo docker_image::${DOCKER_IMAGE} + echo ghcr_image::${GHCR_IMAGE} + echo version::${VERSION} echo ::set-output name=docker_image::${DOCKER_IMAGE} echo ::set-output name=ghcr_image::${GHCR_IMAGE} echo ::set-output name=version::${VERSION}