fix image naming & tagging
This commit is contained in:
19
.github/workflows/build.yml
vendored
19
.github/workflows/build.yml
vendored
@@ -127,26 +127,33 @@ jobs:
|
||||
run: |
|
||||
set -euo pipefail
|
||||
DIR="${{ matrix.dir }}"
|
||||
NAME="${DIR#docker/}" # e.g. '7.4' or 'nginx'
|
||||
# Ensure DIR is set and use basename to derive a reliable NAME
|
||||
if [[ -z "${DIR}" || "${DIR}" == "." ]]; then
|
||||
echo "matrix.dir is empty or '.'; treating as repo root"
|
||||
DIR='.'
|
||||
fi
|
||||
NAME="$(basename "${DIR}")" # e.g. '7.4' or 'nginx'
|
||||
SHA=${GITHUB_SHA::7}
|
||||
|
||||
# Decide repository and tag scheme:
|
||||
# - nginx lane -> gitea.auvem.com/auvem/wordpress-nginx:stable
|
||||
# - other lanes (assumed php variants) -> gitea.auvem.com/auvem/wordpress-php-fpm:<version>-stable
|
||||
if [[ "${NAME}" == "nginx" ]]; then
|
||||
IMAGE="gitea.auvem.com/auvem/wordpress-nginx"
|
||||
IMAGE="gitea.auvem.com/auvem/wordpress-docker/nginx"
|
||||
TAG="stable"
|
||||
else
|
||||
IMAGE="gitea.auvem.com/auvem/wordpress-php-fpm"
|
||||
IMAGE="gitea.auvem.com/auvem/wordpress-docker/php-fpm"
|
||||
# Extract version like 7.4 or 8.1 from the lane name; otherwise use lane name
|
||||
if [[ "${NAME}" =~ ([0-9]+\.[0-9]+) ]]; then
|
||||
if [[ -n "${NAME}" && "${NAME}" =~ ([0-9]+\.[0-9]+) ]]; then
|
||||
VERSION="${BASH_REMATCH[1]}"
|
||||
TAG="${VERSION}-stable"
|
||||
elif [[ "${NAME}" =~ ([0-9]+) ]]; then
|
||||
elif [[ -n "${NAME}" && "${NAME}" =~ ([0-9]+) ]]; then
|
||||
VERSION="${BASH_REMATCH[1]}"
|
||||
TAG="${VERSION}-stable"
|
||||
else
|
||||
elif [[ -n "${NAME}" ]]; then
|
||||
TAG="${NAME}-stable"
|
||||
else
|
||||
TAG="stable"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user