diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 05156ac97..f55343fe6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -87,6 +87,7 @@ jobs: VER="$(git describe --tags 2>/dev/null)" echo "version=${VER}" >> "$GITHUB_OUTPUT" + echo "branch=${REF}" >> "$GITHUB_OUTPUT" echo 'tags<> "$GITHUB_OUTPUT" if [[ "$REF" == "main" ]]; then @@ -105,6 +106,7 @@ jobs: platforms: linux/amd64 build-args: | VERSION=${{ steps.info.outputs.version }} + BRANCH=${{ steps.info.outputs.branch }} publish-image: name: Publish Image diff --git a/Dockerfile b/Dockerfile index b1f4a2bcb..25fd0747c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ FROM ruby:3.2.2-bullseye AS base SHELL ["/bin/bash", "-o", "pipefail", "-c"] RUN apt-get update \ && apt-get install -y --no-install-recommends \ - software-properties-common dirmngr apt-transport-https \ + software-properties-common dirmngr apt-transport-https \ && (curl -sL https://deb.nodesource.com/setup_20.x | bash -) \ && rm -rf /var/lib/apt/lists/* @@ -43,8 +43,10 @@ COPY ./docker/wait-for.sh /docker-entrypoint.sh COPY --chown=postal . . # Export the version -ARG VERSION=unspecified -RUN echo $VERSION > VERSION +ARG VERSION=null +ARG BRANCH=null +RUN echo $VERSION > VERSION \ + && echo $BRANCH > BRANCH # Set paths for when running in a container ENV POSTAL_CONFIG_FILE_PATH=/config/postal.yml