Skip to content

Commit

Permalink
[docker-image] Push versioned build-essential tags
Browse files Browse the repository at this point in the history
Signed-off-by: Eugenio Paolantonio (g7) <[email protected]>
  • Loading branch information
g7 committed Dec 14, 2024
1 parent 0fc64aa commit 10a8be4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,10 @@ jobs:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: ./src/push_docker_image.sh "${{ matrix.arch }}/${{ matrix.namespace }}/${{ matrix.template }}:${{ matrix.dist }}"

- name: Deploy versioned image
if: "${{ github.ref == 'refs/heads/master' && matrix.template == 'build-essential' }}"
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: ./src/push_docker_image.sh "${{ matrix.arch }}/${{ matrix.namespace }}/${{ matrix.template }}:${{ matrix.dist }}" versioned
8 changes: 8 additions & 0 deletions src/push_docker_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ info "Pushing ${IMAGE}"
ARCH=$(echo "${IMAGE}" | cut -d"/" -f1)
TARGET_TAG=quay.io/${IMAGE/"${ARCH}/"/""}-"${ARCH}"

# Handle versioned images
if [ "${2}" == "versioned" ]; then
version="$(docker run --rm -a stdout --entrypoint cat ${IMAGE} /etc/droidian-release)"
[ -n "${version}" ] || error "Unable to determine image version"

TARGET_TAG=$(echo "${TARGET_TAG}" | cut -d":" -f1):"${version}-${ARCH}"
fi

echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin quay.io
docker tag "${IMAGE}" "${TARGET_TAG}"
docker push "${TARGET_TAG}"

0 comments on commit 10a8be4

Please sign in to comment.