Setup release of docker images to dockerhub

This commit is contained in:
Martin Šalata
2021-04-02 23:15:08 +02:00
parent cfa76c2953
commit c80ce5e9a6
5 changed files with 19 additions and 12 deletions

View File

@@ -9,11 +9,6 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.15.0'
- name: Checkout
uses: actions/checkout@v1
with:
@@ -24,5 +19,11 @@ jobs:
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: make build-image
run: make build-image
- name: make image
run: make image
env:
DOCKER_USER: '${{ secrets.DOCKER_USER }}'
DOCKER_TOKEN: '${{ secrets.DOCKER_TOKEN }}'
- name: make docker-logout
run: make docker-logout

View File

@@ -18,7 +18,7 @@ export GOPATH ?= $(GOPATH_DEFAULT)
TESTARGS_DEFAULT := "-v"
export TESTARGS ?= $(TESTARGS_DEFAULT)
DEST := $(GOPATH)/src/$(GIT_HOST)/$(BASE_DIR)
IMAGE_TAG ?= $(shell cat "$(REPO_ROOT)/VERSION")-$(shell git describe --match=$(git rev-parse --short=8 HEAD) --tags --always --dirty)
IMAGE_TAG ?= $(shell cat "$(REPO_ROOT)/VERSION")
LOCAL_OS := $(shell uname)
@@ -78,7 +78,13 @@ build-linux:
# image section
############################################################
image: build-image push-image
image: docker-login build-image push-image
docker-login:
@echo ${DOCKER_TOKEN} | docker login -u ${DOCKER_USER} --password-stdin
docker-logout:
@docker logout
build-image:
@echo "Building the docker image: $(IMAGE_REPO)/$(IMAGE_NAME):$(IMAGE_TAG)..."

View File

@@ -1 +1 @@
v0.0.1
v0.0.7

View File

@@ -1,4 +1,4 @@
FROM golang:1.14 AS builder
FROM golang:1.15 AS builder
WORKDIR /go/src/github.com/ysoftdevs/imagepullsecret-injector
COPY . .

View File

@@ -20,4 +20,4 @@ version: 0.0.4
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: v0.0.1
appVersion: v0.0.7