faster uploads, including the branch name
All checks were successful
Build and push nixos-based docker container / build (push) Successful in 17s

This commit is contained in:
James Andariese 2024-08-03 23:51:51 -05:00
parent 89b334168a
commit a8697f41da

View File

@ -19,9 +19,11 @@ jobs:
skopeo login --username ${{ secrets.DOCKER_USER }} --password ${{ secrets.DOCKER_PASSWORD }} "$REGISTRY"
( # echo tags into the image uploader's read loop
echo "sha-$(echo "$GITHUB_SHA" | cut -c 1-8)"
echo "$GITHUB_REF_NAME-$(date +%Y%m%d-%H%M%S)"
) | while read -r TAG;do
nix run .#upload-image "docker://$REGISTRY/$PACKAGE:$TAG"
MAINTAG="sha-$(echo "$GITHUB_SHA" | cut -c 1-8)"
nix run .#upload-image "docker://$REGISTRY/$PACKAGE:$MAINTAG"
for TAG in \
"$GITHUB_REF_NAME" \
"$GITHUB_REF_NAME-$(date +%Y%m%d-%H%M%S)" \
; do
skopeo copy "docker://$REGISTRY/$PACKAGE:$MAINTAG" "docker://$REGISTRY/$PACKAGE:$TAG"
done