Skip to content

Commit 173c691

Browse files
author
QP Hou
authored
automate public docker image release (#15)
1 parent 5bc094b commit 173c691

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

.github/workflows/cicd.yml

+11
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ jobs:
2626
- name: Run test
2727
run: make test
2828

29+
- name: Test Docker build
30+
run: docker build --rm -t ghcr.io/scribd/objinsync:latest .
31+
32+
2933
release:
3034
name: Release
3135
if: startsWith(github.ref, 'refs/tags/')
@@ -53,3 +57,10 @@ jobs:
5357
args: release --rm-dist
5458
env:
5559
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
61+
- name: Build and publish docker image
62+
run: |
63+
VERSION=${GITHUB_REF##*/}
64+
echo ${SCRIBDBOT_GH_CONTAINER_REGISTRY_TOKEN} | docker login ghcr.io -u scribdbot --password-stdin
65+
docker build --rm -t "ghcr.io/scribd/objinsync:${VERSION}" .
66+
docker push "ghcr.io/scribd/objinsync:${VERSION}"

Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
FROM golang:1.16.3 as build
2+
LABEL org.opencontainers.image.source https://github.com/scribd/objinsync
23
ADD . /app
34
WORKDIR /app
45

0 commit comments

Comments
 (0)