Repaired build workflow
Build and Publish RMManager Image / build (push) Successful in 46s

This commit is contained in:
Lyncoln
2026-10-30 23:41:42 -04:00
parent f90c3b1424
commit 75b4cc92da
+66 -8
View File
@@ -35,9 +35,10 @@ jobs:
fi fi
git checkout --detach FETCH_HEAD git checkout --detach FETCH_HEAD
git config --global --add safe.directory "$PWD"
# --------------------------------------------- # ---------------------------------------------
# Determine image tags # Determine image version and commit SHA
# --------------------------------------------- # ---------------------------------------------
- name: Determine version - name: Determine version
id: version id: version
@@ -45,12 +46,13 @@ jobs:
set -euo pipefail set -euo pipefail
SHORT_SHA="$(git rev-parse --short=7 HEAD)" SHORT_SHA="$(git rev-parse --short=7 HEAD)"
echo "sha=$SHORT_SHA" >> "$GITHUB_OUTPUT" echo "sha=$SHORT_SHA" >> "$GITHUB_OUTPUT"
if [ -f VERSION ]; then if [ -f VERSION ]; then
VERSION="$(tr -d '[:space:]' < VERSION)" VERSION="$(tr -d '[:space:]' < VERSION)"
echo "version=$VERSION" >> "$GITHUB_OUTPUT" echo "version=$VERSION" >> "$GITHUB_OUTPUT"
else
echo "version=" >> "$GITHUB_OUTPUT"
fi fi
# --------------------------------------------- # ---------------------------------------------
@@ -69,7 +71,7 @@ jobs:
--password-stdin --password-stdin
# --------------------------------------------- # ---------------------------------------------
# Build container image # Build and export container image
# --------------------------------------------- # ---------------------------------------------
- name: Build RMManager image - name: Build RMManager image
env: env:
@@ -85,14 +87,62 @@ jobs:
-f Containerfile \ -f Containerfile \
-t "$FULL_IMAGE:latest" \ -t "$FULL_IMAGE:latest" \
-t "$FULL_IMAGE:sha-$SHORT_SHA" \ -t "$FULL_IMAGE:sha-$SHORT_SHA" \
--output "type=docker,dest=$RUNNER_TEMP/rmmanager-built.tar" \
. .
# ---------------------------------------------
# Load exported image into Docker
# ---------------------------------------------
- name: Load RMManager image
run: |
set -euo pipefail
docker load \
--input "$RUNNER_TEMP/rmmanager-built.tar"
# ---------------------------------------------
# Add optional version tag
# ---------------------------------------------
- name: Tag RMManager image
env:
REGISTRY: ${{ vars.REGISTRY }}
VERSION: ${{ steps.version.outputs.version }}
run: |
set -euo pipefail
FULL_IMAGE="$REGISTRY/david/rmmanager"
if [ -n "$VERSION" ]; then if [ -n "$VERSION" ]; then
docker tag "$FULL_IMAGE:latest" "$FULL_IMAGE:v$VERSION" docker tag \
"$FULL_IMAGE:latest" \
"$FULL_IMAGE:v$VERSION"
fi fi
# --------------------------------------------- # ---------------------------------------------
# Publish image # Verify local image and tags
# ---------------------------------------------
- name: Verify RMManager image
env:
REGISTRY: ${{ vars.REGISTRY }}
VERSION: ${{ steps.version.outputs.version }}
SHORT_SHA: ${{ steps.version.outputs.sha }}
run: |
set -euo pipefail
FULL_IMAGE="$REGISTRY/david/rmmanager"
docker version
docker image ls
docker image inspect "$FULL_IMAGE:latest"
docker image inspect "$FULL_IMAGE:sha-$SHORT_SHA"
if [ -n "$VERSION" ]; then
docker image inspect "$FULL_IMAGE:v$VERSION"
fi
# ---------------------------------------------
# Publish image to Gitea registry
# --------------------------------------------- # ---------------------------------------------
- name: Push RMManager image - name: Push RMManager image
env: env:
@@ -112,13 +162,21 @@ jobs:
fi fi
# --------------------------------------------- # ---------------------------------------------
# Summary # Report successful build
# --------------------------------------------- # ---------------------------------------------
- name: Report build - name: Report build
env: env:
REGISTRY: ${{ vars.REGISTRY }} REGISTRY: ${{ vars.REGISTRY }}
VERSION: ${{ steps.version.outputs.version }}
SHORT_SHA: ${{ steps.version.outputs.sha }} SHORT_SHA: ${{ steps.version.outputs.sha }}
run: | run: |
echo "RMManager build completed" set -euo pipefail
echo "RMManager build and publish completed"
echo "Image: $REGISTRY/david/rmmanager" echo "Image: $REGISTRY/david/rmmanager"
echo "Commit: $SHORT_SHA" echo "Latest tag: latest"
echo "Commit tag: sha-$SHORT_SHA"
if [ -n "$VERSION" ]; then
echo "Version tag: v$VERSION"
fi