Publish container images to GitHub container registry.
@@ -19,6 +19,10 @@ if [[ -z "$DOCKER_HUB_DEPLOY_KEY" ]]; then
echo "Environment variable DOCKER_HUB_DEPLOY_KEY must be set, but is empty."
exit 1
fi
+if [[ -z "$GHCR_DEPLOY_KEY" ]]; then
+ echo "Environment variable GHCR_DEPLOY_KEY must be set, but is empty."
+ exit 1
+fi
BUILD_DIR=$(mktemp -d)
trap "rm -rf $BUILD_DIR" EXIT
@@ -27,8 +31,14 @@ cd $BUILD_DIR
git clone --depth 1 https://github.com/vespa-engine/docker-image
cd docker-image
-docker login --username aressem --password "$DOCKER_HUB_DEPLOY_KEY"
docker build --build-arg VESPA_VERSION=$VESPA_VERSION --tag docker.io/vespaengine/vespa:$VESPA_VERSION --tag docker.io/vespaengine/vespa:latest .
+# Push to Docker Hub
+docker login --username aressem --password "$DOCKER_HUB_DEPLOY_KEY"
docker push docker.io/vespaengine/vespa:$VESPA_VERSION
docker push docker.io/vespaengine/vespa:latest
+
+# Push to GitHub Container Registry
+docker login --username aressem --password "$DOCKER_HUB_DEPLOY_KEY" ghcr.io
+docker push ghcr.io/vespa-engine/vespa:$VESPA_VERSION
+docker push ghcr.io/vespa-engine/vespa:latest
