Skip to content
This repository has been archived by the owner on Jul 5, 2021. It is now read-only.

Commit

Permalink
Merge pull request #71 from mcavoyk/fix-ci-docker
Browse files Browse the repository at this point in the history
Fix ci docker build
  • Loading branch information
mcavoyk authored Mar 22, 2021
2 parents 25b3f4d + 2083192 commit 7829aed
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ env:
KUBEBUILDER_VERSION: '2.3.1'
DOCKER_BUILDX_VERSION: 'v0.4.2'

# Common users. We can't run a step 'if secrets.GHCR_USER != ""' but we can run
# a step 'if env.GHCR_USER' != ""', so we copy these to succinctly test whether
# Common users. We can't run a step 'if secrets.GHCR_USERNAME != ""' but we can run
# a step 'if env.GHCR_USERNAME' != ""', so we copy these to succinctly test whether
# credentials have been provided before trying to run steps that need them.
GHCR_USER: ${{ secrets.GHCR_USERNAME }}
GHCR_USERNAME: ${{ secrets.GHCR_USERNAME }}

jobs:
detect-noop:
Expand Down Expand Up @@ -220,6 +220,10 @@ jobs:
restore-keys: ${{ runner.os }}-pkg-

- name: Build Artifacts
env:
# We're using docker buildx, which doesn't actually load the images it
# builds by default. Specifying --load does so.
BUILD_ARGS: "--load"
run: make docker.build

- name: Login to Docker
Expand All @@ -231,8 +235,8 @@ jobs:
password: ${{ secrets.GHCR_TOKEN }}

- name: Publish Artifacts
run: make docker.push
if: env.GHCR_USERNAME != ''
run: make docker.push

- name: Promote Artifacts to main release channel
if: github.ref == 'refs/heads/main' && env.GHCR_USERNAME != ''
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ build.all: docker.build helm.build

docker.build: build ## Build the docker image
@$(INFO) docker build
@docker build . -t $(IMAGE_REGISTRY):$(VERSION)
@docker build . $(BUILD_ARGS) -t $(IMAGE_REGISTRY):$(VERSION)
@$(OK) docker build

docker.push:
Expand Down

0 comments on commit 7829aed

Please sign in to comment.