Skip to content

Commit

Permalink
[GHA] Build, login & Publish Images (cloud-bulldozer#127)
Browse files Browse the repository at this point in the history
This PR allows users to build, login to quay and publish
container images

Signed-off-by: Krishna Harsha Voora <krvoora@redhat.com>
  • Loading branch information
krishvoor committed Dec 18, 2023
1 parent 7b34f14 commit 842a364
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/build-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,13 @@ jobs:
with:
go-version: ${{ env.GO_VER }}

- name: Login to the ${{ env.CONTAINER_REGISTRY }} Container Registry
run: podman login quay.io -u ${QUAY_USER} -p ${QUAY_TOKEN}
env:
QUAY_USER: ${{ secrets.QUAY_USER }}
QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }}

- name: Build and Push multi-arch Image
id: push
run: |
make build
podman login quay.io -u ${QUAY_USER} -p ${QUAY_TOKEN}
make gha-push
env:
GO_VER: ${{ env.GO_VER }}
GO_VER: ${{ env.GO_VER }}
QUAY_USER: ${{ secrets.QUAY_USER }}
QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }}
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ container-build: build
--build-arg RHEL_VERSION=$(RHEL_VERSION) \
-t $(CONTAINER_NS)/$(BIN) ./containers

gha-build:
gha-build: build
@echo "Building the container image for GHA"
$(CONTAINER_BUILD) -f containers/Containerfile \
--build-arg RHEL_VERSION=$(RHEL_VERSION) --platform=linux/amd64,linux/arm64,linux/ppc64le,linux/s390x \
-t $(CONTAINER_NS) ./containers --manifest=$(CONTAINER_NS)-manifest:latest

gha-push: build gha-build
gha-push:
@echo "Pushing Container Images & manifest"
$(CONTAINER) manifest push $(CONTAINER_NS)-manifest:latest $(CONTAINER_NS)

Expand Down

0 comments on commit 842a364

Please sign in to comment.