Mirror release images to Docker Hub for legacy agent updates
Agents deployed with the old Docker Hub image (gmcintire/towerops-agent) auto-update via Watchtower. This pushes release builds to both GHCR and Docker Hub so those agents continue receiving updates.
This commit is contained in:
parent
f8c8c8bb8e
commit
0cb673d9c4
1 changed files with 30 additions and 4 deletions
34
.github/workflows/ci.yml
vendored
34
.github/workflows/ci.yml
vendored
|
|
@ -21,6 +21,7 @@ concurrency:
|
||||||
env:
|
env:
|
||||||
REGISTRY: ghcr.io
|
REGISTRY: ghcr.io
|
||||||
IMAGE_NAME: ${{ github.repository }}
|
IMAGE_NAME: ${{ github.repository }}
|
||||||
|
DOCKERHUB_IMAGE: gmcintire/towerops-agent
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
RUSTFLAGS: -C link-arg=-fuse-ld=lld
|
RUSTFLAGS: -C link-arg=-fuse-ld=lld
|
||||||
|
|
||||||
|
|
@ -186,6 +187,12 @@ jobs:
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Log in to Docker Hub
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
username: gmcintire
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: useblacksmith/build-push-action@v2
|
uses: useblacksmith/build-push-action@v2
|
||||||
with:
|
with:
|
||||||
|
|
@ -198,6 +205,7 @@ jobs:
|
||||||
BUILDKIT_INLINE_CACHE=1
|
BUILDKIT_INLINE_CACHE=1
|
||||||
tags: |
|
tags: |
|
||||||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.version.outputs.version }}-${{ matrix.arch }}
|
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.version.outputs.version }}-${{ matrix.arch }}
|
||||||
|
docker.io/${{ env.DOCKERHUB_IMAGE }}:${{ needs.version.outputs.version }}-${{ matrix.arch }}
|
||||||
|
|
||||||
# Create multi-arch manifest after both builds complete
|
# Create multi-arch manifest after both builds complete
|
||||||
manifest:
|
manifest:
|
||||||
|
|
@ -216,32 +224,50 @@ jobs:
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Log in to Docker Hub
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
username: gmcintire
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Create and push manifests
|
- name: Create and push manifests
|
||||||
run: |
|
run: |
|
||||||
VERSION="${{ needs.version.outputs.version }}"
|
VERSION="${{ needs.version.outputs.version }}"
|
||||||
SHORT_SHA="${{ needs.version.outputs.short_sha }}"
|
SHORT_SHA="${{ needs.version.outputs.short_sha }}"
|
||||||
IMAGE="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}"
|
IMAGE="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}"
|
||||||
|
DH_IMAGE="docker.io/${{ env.DOCKERHUB_IMAGE }}"
|
||||||
|
|
||||||
# Create manifest for version tag
|
# Create GHCR manifests
|
||||||
docker buildx imagetools create -t ${IMAGE}:${VERSION} \
|
docker buildx imagetools create -t ${IMAGE}:${VERSION} \
|
||||||
${IMAGE}:${VERSION}-amd64 \
|
${IMAGE}:${VERSION}-amd64 \
|
||||||
${IMAGE}:${VERSION}-arm64
|
${IMAGE}:${VERSION}-arm64
|
||||||
|
|
||||||
# Create manifest for latest
|
|
||||||
docker buildx imagetools create -t ${IMAGE}:latest \
|
docker buildx imagetools create -t ${IMAGE}:latest \
|
||||||
${IMAGE}:${VERSION}-amd64 \
|
${IMAGE}:${VERSION}-amd64 \
|
||||||
${IMAGE}:${VERSION}-arm64
|
${IMAGE}:${VERSION}-arm64
|
||||||
|
|
||||||
# Create manifest for sha tag
|
|
||||||
docker buildx imagetools create -t ${IMAGE}:sha-${SHORT_SHA} \
|
docker buildx imagetools create -t ${IMAGE}:sha-${SHORT_SHA} \
|
||||||
${IMAGE}:${VERSION}-amd64 \
|
${IMAGE}:${VERSION}-amd64 \
|
||||||
${IMAGE}:${VERSION}-arm64
|
${IMAGE}:${VERSION}-arm64
|
||||||
|
|
||||||
|
# Create Docker Hub manifests
|
||||||
|
docker buildx imagetools create -t ${DH_IMAGE}:${VERSION} \
|
||||||
|
${DH_IMAGE}:${VERSION}-amd64 \
|
||||||
|
${DH_IMAGE}:${VERSION}-arm64
|
||||||
|
|
||||||
|
docker buildx imagetools create -t ${DH_IMAGE}:latest \
|
||||||
|
${DH_IMAGE}:${VERSION}-amd64 \
|
||||||
|
${DH_IMAGE}:${VERSION}-arm64
|
||||||
|
|
||||||
|
docker buildx imagetools create -t ${DH_IMAGE}:sha-${SHORT_SHA} \
|
||||||
|
${DH_IMAGE}:${VERSION}-amd64 \
|
||||||
|
${DH_IMAGE}:${VERSION}-arm64
|
||||||
|
|
||||||
- name: Summary
|
- name: Summary
|
||||||
run: |
|
run: |
|
||||||
echo "### Released version: ${{ needs.version.outputs.version }}" >> $GITHUB_STEP_SUMMARY
|
echo "### Released version: ${{ needs.version.outputs.version }}" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "Multi-architecture build (amd64, arm64) - built in parallel" >> $GITHUB_STEP_SUMMARY
|
echo "Multi-architecture build (amd64, arm64) - built in parallel" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "Tags pushed:" >> $GITHUB_STEP_SUMMARY
|
echo "Tags pushed to GHCR and Docker Hub:" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "- \`latest\`" >> $GITHUB_STEP_SUMMARY
|
echo "- \`latest\`" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "- \`${{ needs.version.outputs.version }}\`" >> $GITHUB_STEP_SUMMARY
|
echo "- \`${{ needs.version.outputs.version }}\`" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "- \`sha-${{ needs.version.outputs.short_sha }}\`" >> $GITHUB_STEP_SUMMARY
|
echo "- \`sha-${{ needs.version.outputs.short_sha }}\`" >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue