Skip to content

Commit

Permalink
Update GitHub workflow to build docker images on RC commit (#922)
Browse files Browse the repository at this point in the history
Had to re-file this PR because workflows are run based on the workflow definition in the branch, not the main branch.
  • Loading branch information
ge0metrix authored Feb 15, 2024
1 parent e3e0b5d commit 5b1e1ee
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ on:
pull_request:
branches: master
push:
branches: master
branches:
- master
- rc/**
tags:
- v*
release:
Expand All @@ -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
Expand All @@ -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}
Expand Down

0 comments on commit 5b1e1ee

Please sign in to comment.