Switch dockerhub for Github's docker registry

This commit is contained in:
Martin Šalata
2021-04-05 21:09:38 +02:00
parent c97fc465e8
commit 6234301c85
2 changed files with 6 additions and 5 deletions

View File

@@ -13,7 +13,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v1
with:
ref: main
ref: ${{ github.ref }}
- name: Configure Git
run: |
@@ -23,8 +23,8 @@ jobs:
- name: Build and push docker images (make image)
run: make image
env:
DOCKER_USER: '${{ secrets.DOCKER_USER }}'
DOCKER_TOKEN: '${{ secrets.DOCKER_TOKEN }}'
DOCKER_USER: ${GITHUB_ACTOR}
DOCKER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Logout from dockerhub (make docker-logout)
run: make docker-logout

View File

@@ -1,7 +1,8 @@
# Image URL to use all building/pushing image targets;
# Use your own docker registry and image name for dev/test by overridding the
# IMAGE_REPO, IMAGE_NAME and IMAGE_TAG environment variable.
IMAGE_REPO ?= marshallmarshall
REPOSITORY_BASE ?= ghcr.io
IMAGE_REPO ?= $(REPOSITORY_BASE)/ysoftdevs/imagepullsecret-injector
IMAGE_NAME ?= imagepullsecret-injector
GENERATOR_IMAGE_NAME ?= webhook-cert-generator
@@ -81,7 +82,7 @@ build-linux:
image: docker-login build-image push-image
docker-login:
@echo ${DOCKER_TOKEN} | docker login -u ${DOCKER_USER} --password-stdin
@echo "$(DOCKER_TOKEN)" | docker login -u "$(DOCKER_USER)" --password-stdin "$(REPOSITORY_BASE)"
docker-logout:
@docker logout