mirror of
https://github.com/sstent/minihass.git
synced 2025-12-06 03:21:36 +00:00
Update container-build.yml
This commit is contained in:
14
.github/workflows/container-build.yml
vendored
14
.github/workflows/container-build.yml
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user