Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GitHub workflow to build docker images on RC commit #922

Merged
merged 1 commit into from
Feb 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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