Skip to content

Commit 52da506

Browse files
committed
ci: tag and push to envbox-preview on merge to main
Signed-off-by: Cian Johnston <[email protected]>
1 parent 7dc2c25 commit 52da506

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

.github/workflows/ci.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,9 @@ jobs:
259259
- name: build image
260260
run: make -j build/image/envbox
261261

262-
- name: tag image
263-
run: docker tag envbox ghcr.io/coder/envbox:latest
264-
265-
- name: push image
266-
run: docker push ghcr.io/coder/envbox:latest
262+
- name: Tag and push envbox-preview
263+
run: |
264+
VERSION=$(./scripts/version.sh)-dev-$(git rev-parse --short HEAD)
265+
BASE=ghcr.io/coder/envbox-preview
266+
docker tag envbox "${BASE}:${VERSION}"
267+
docker push "${BASE}:${VERSION}"

scripts/version.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
cd "$(dirname "${BASH_SOURCE[0]}")"
5+
6+
last_tag="$(git describe --tags --abbrev=0)"
7+
version="$last_tag"
8+
9+
# Remove the "v" prefix.
10+
echo "${version#v}"

0 commit comments

Comments
 (0)