diff --git a/Makefile b/Makefile
index f582b69..2d3626c 100644
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,22 @@
+TAG := $(GITHUB_REF)
+ifeq ($(TAG),)
+	TAG := $(shell git symbolic-ref --short -q HEAD)
+endif
+ifeq ($(TAG),)
+	TAG := $(shell git rev-parse --short --verify HEAD)
+endif
+
 define docker_build_and_push
 	docker buildx build \
 		--push \
 		--platform linux/arm64,linux/amd64 \
-		-t "schickling/$1:$(if $2,$2,latest)" \
+		-t "schickling/$1:$(if $2,$2,$(TAG))" \
 		./$1
 endef
 
 help:
 	@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n  make \033[36m<target>\033[0m\n\nTargets:\n"} /^[0-9a-zA-Z_-]+:.*?##/ { printf "  \033[36m%-18s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST)
+	@echo $(TAG)
 
 all: beanstalkd beanstalkd-console hugin jekyll latex mailcatcher mysql-backup-s3 nginx-envtpl nodejs octave opencv postgres-backup-s3 postgres-restore-s3 redis-commander rust s3cmd scala-sbt-docker swagger-ui thumbor-nginx-cors ## Build all images