fix repo name and build single image

Signed-off-by: Simon Smith <simonsmith5521@gmail.com>
This commit is contained in:
Simon Smith 2025-10-26 10:51:23 +00:00
parent 1e0e0847da
commit 14224f2f10

View File

@ -82,7 +82,7 @@ jobs:
--build-arg DISABLE_TRANSLATE=yes \
--build-arg DISABLE_EXTRACT=yes \
--build-arg PREINSTALL_LIBS=true \
-t ghcr.io/${{ github.repository_owner }}/meshcentral:${{ github.ref_name }} \
-t ghcr.io/${{ github.repository_owner && github.repository_owner.toLowerCase() }}/meshcentral:${{ github.ref_name }}-amd64 \
--push \
./docker
@ -126,7 +126,7 @@ jobs:
--build-arg DISABLE_TRANSLATE=yes \
--build-arg DISABLE_EXTRACT=yes \
--build-arg PREINSTALL_LIBS=true \
-t ghcr.io/${{ github.repository_owner }}/meshcentral:${{ github.ref_name }} \
-t ghcr.io/${{ github.repository_owner && github.repository_owner.toLowerCase() }}/meshcentral:${{ github.ref_name }}-arm64 \
--push \
./docker
@ -170,7 +170,7 @@ jobs:
--build-arg DISABLE_TRANSLATE=yes \
--build-arg DISABLE_EXTRACT=yes \
--build-arg PREINSTALL_LIBS=true \
-t ghcr.io/${{ github.repository_owner }}/meshcentral:${{ github.ref_name }} \
-t ghcr.io/${{ github.repository_owner && github.repository_owner.toLowerCase() }}/meshcentral:${{ github.ref_name }}-armv7 \
--push \
./docker
@ -214,6 +214,45 @@ jobs:
--build-arg DISABLE_TRANSLATE=yes \
--build-arg DISABLE_EXTRACT=yes \
--build-arg PREINSTALL_LIBS=true \
-t ghcr.io/${{ github.repository_owner }}/meshcentral:${{ github.ref_name }} \
-t ghcr.io/${{ github.repository_owner && github.repository_owner.toLowerCase() }}/meshcentral:${{ github.ref_name }}-armv6 \
--push \
./docker
merge-manifest:
runs-on: ubuntu-latest
needs: [build-amd64, build-arm64, build-armv7, build-armv6]
name: Create and Push Multi-Arch Manifest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create and push multi-arch manifest
run: |
docker buildx imagetools create \
-t ghcr.io/${{ github.repository_owner && github.repository_owner.toLowerCase() }}/meshcentral:${{ github.ref_name }} \
ghcr.io/${{ github.repository_owner && github.repository_owner.toLowerCase() }}/meshcentral:${{ github.ref_name }}-amd64 \
ghcr.io/${{ github.repository_owner && github.repository_owner.toLowerCase() }}/meshcentral:${{ github.ref_name }}-arm64 \
ghcr.io/${{ github.repository_owner && github.repository_owner.toLowerCase() }}/meshcentral:${{ github.ref_name }}-armv7 \
ghcr.io/${{ github.repository_owner && github.repository_owner.toLowerCase() }}/meshcentral:${{ github.ref_name }}-armv6
- name: Delete architecture-specific tags
run: |
ghcr_repo=ghcr.io/${{ github.repository_owner && github.repository_owner.toLowerCase() }}/meshcentral
for arch in amd64 arm64 armv7 armv6; do
echo "Deleting $ghcr_repo:${{ github.ref_name }}-$arch ..."
digest=$(docker buildx imagetools inspect $ghcr_repo:${{ github.ref_name }}-$arch --format '{{.Manifest.Digest}}')
if [ -n "$digest" ]; then
curl -s -X DELETE -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
"https://ghcr.io/v2/${{ github.repository_owner && github.repository_owner.toLowerCase() }}/meshcentral/manifests/$digest"
fi
done
env:
DOCKER_CLI_EXPERIMENTAL: enabled