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

This commit is contained in:
James Andariese 2024-08-03 23:51:51 -05:00
parent bc7c4068c1
commit 2131b931b7

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