Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit 5a9d649

Browse files
committed
Script to make publishing docker image easier
1 parent c62a7ac commit 5a9d649

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

script/publish

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
#/ Usage: script/publish
3+
#/
4+
#/ Build a docker image of the semantic CLI and publish to the GitHub Package Registry
5+
6+
set -e
7+
cd $(dirname "$0")/..
8+
9+
VERSION="0.6.0"
10+
BUILD_SHA=$(git rev-parse HEAD 2>/dev/null)
11+
DOCKER_IMAGE=docker.pkg.github.com/github/semantic/semantic
12+
13+
# Build
14+
docker build -t $DOCKER_IMAGE .
15+
16+
# Make sure semantic is in the image.
17+
docker run --rm $DOCKER_IMAGE --version
18+
19+
# Requires that you've logged in to the GPR (e.g. `docker login docker.pkg.github.com`)
20+
# https://help.github.com/en/articles/configuring-docker-for-use-with-github-package-registry
21+
docker tag $DOCKER_IMAGE $DOCKER_IMAGE:latest
22+
docker tag $DOCKER_IMAGE $DOCKER_IMAGE:$VERSION
23+
docker tag $DOCKER_IMAGE $DOCKER_IMAGE:sha_$BUILD_SHA
24+
docker push $DOCKER_IMAGE:latest
25+
docker push $DOCKER_IMAGE:$VERSION
26+
docker push $DOCKER_IMAGE:sha_$BUILD_SHA

0 commit comments

Comments
 (0)