fix image naming & tagging

This commit is contained in:
Elijah Duffy
2025-12-07 18:24:08 -08:00
parent 9f2d94a878
commit bfccacb192
2 changed files with 15 additions and 8 deletions

View File

@@ -127,26 +127,33 @@ jobs:
run: | run: |
set -euo pipefail set -euo pipefail
DIR="${{ matrix.dir }}" 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} SHA=${GITHUB_SHA::7}
# Decide repository and tag scheme: # Decide repository and tag scheme:
# - nginx lane -> gitea.auvem.com/auvem/wordpress-nginx:stable # - nginx lane -> gitea.auvem.com/auvem/wordpress-nginx:stable
# - other lanes (assumed php variants) -> gitea.auvem.com/auvem/wordpress-php-fpm:<version>-stable # - other lanes (assumed php variants) -> gitea.auvem.com/auvem/wordpress-php-fpm:<version>-stable
if [[ "${NAME}" == "nginx" ]]; then if [[ "${NAME}" == "nginx" ]]; then
IMAGE="gitea.auvem.com/auvem/wordpress-nginx" IMAGE="gitea.auvem.com/auvem/wordpress-docker/nginx"
TAG="stable" TAG="stable"
else 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 # 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]}" VERSION="${BASH_REMATCH[1]}"
TAG="${VERSION}-stable" TAG="${VERSION}-stable"
elif [[ "${NAME}" =~ ([0-9]+) ]]; then elif [[ -n "${NAME}" && "${NAME}" =~ ([0-9]+) ]]; then
VERSION="${BASH_REMATCH[1]}" VERSION="${BASH_REMATCH[1]}"
TAG="${VERSION}-stable" TAG="${VERSION}-stable"
else elif [[ -n "${NAME}" ]]; then
TAG="${NAME}-stable" TAG="${NAME}-stable"
else
TAG="stable"
fi fi
fi fi

View File

@@ -73,7 +73,7 @@ services:
- db_data:/var/lib/mysql - db_data:/var/lib/mysql
php-fpm: php-fpm:
image: gitea.auvem.com/auvem/wordpress-php-fpm:7.4-stable image: gitea.auvem.com/auvem/wordpress-docker/php-fpm:7.4-stable
restart: unless-stopped restart: unless-stopped
environment: environment:
WORDPRESS_DB_HOST: db:3306 WORDPRESS_DB_HOST: db:3306
@@ -84,7 +84,7 @@ services:
- ./wp_root:/var/www/html:rw - ./wp_root:/var/www/html:rw
nginx: nginx:
image: gitea.auvem.com/auvem/wordpress-nginx:stable image: gitea.auvem.com/auvem/wordpress-docker/nginx:stable
ports: ports:
- "80:80" - "80:80"
depends_on: depends_on: