Add deploy script
CI / build (push) Successful in 10m21s
CI / docker (push) Successful in 19s

This commit is contained in:
Georgi Gardev
2026-07-11 13:25:48 +03:00
parent 6af05728a3
commit 600333fb70
Executable
+34
View File
@@ -0,0 +1,34 @@
#!/usr/bin/env bash
# Tags a new version, builds the image with docker buildx, and publishes it
# to the Gitea container registry.
#
# Usage: ./deploy.sh [patch|minor|major|x.y.z] (default: patch)
#
# Requires: docker login git.gar.dev
set -euo pipefail
IMAGE="git.gar.dev/georgesg/vertex"
PLATFORMS="${PLATFORMS:-linux/amd64,linux/arm64}"
BUMP="${1:-patch}"
cd "$(dirname "$0")"
if [[ -n "$(git status --porcelain)" ]]; then
echo "error: working tree is not clean — commit or stash first" >&2
exit 1
fi
# Bumps package.json, commits, and creates the vX.Y.Z git tag.
npm version "$BUMP" --message "Release %s"
VERSION="$(node -p "require('./package.json').version")"
docker buildx build \
--platform "$PLATFORMS" \
--tag "$IMAGE:$VERSION" \
--tag "$IMAGE:latest" \
--push \
.
git push origin HEAD "v$VERSION"
echo "published $IMAGE:$VERSION and $IMAGE:latest"