Update container-build.yml

This commit is contained in:
2025-11-20 09:13:25 -08:00
committed by GitHub
parent c36c24d256
commit 61d233a870

View File

@@ -25,13 +25,17 @@ jobs:
- name: Prepare Registry Environment
id: prep
run: |
# 1. Dynamic Registry Detection
# This reads the Gitea ROOT_URL automatically.
if [[ "${{ github.server_url }}" == *"github.com"* ]]; then
echo "REGISTRY=ghcr.io" >> $GITHUB_ENV
else
# Strip protocol (http/https) to get just the hostname:port
# Strips 'https://' and path to get 'gitea.service.dc1.fbleagh.duckdns.org'
CLEAN_HOST=$(echo "${{ github.server_url }}" | sed -e 's|^[^/]*//||' -e 's|/.*$||')
echo "REGISTRY=$CLEAN_HOST" >> $GITHUB_ENV
fi
# 2. Lowercase Image Name
IMAGE_NAME=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
echo "IMAGE_NAME=$IMAGE_NAME" >> $GITHUB_ENV
@@ -42,14 +46,10 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# UPDATED STEP: Allow HTTP/Insecure registry
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
buildkitd-config-inline: |
[registry."${{ env.REGISTRY }}"]
http = true
insecure = true
# NOTE: "http = true" block removed because you are now on SSL.
# If your certificate is valid, you don't need any config here.
- name: Build and push multi-arch Docker image
uses: docker/build-push-action@v5