Skip to content

Commit

Permalink
Build hostplumber image via github action
Browse files Browse the repository at this point in the history
  • Loading branch information
shweta50 committed Sep 18, 2024
1 parent 9d2a512 commit bfc6626
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 3 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/hostplumber-multiarch-build-and-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: docker
on:
push:
branches:
- 'master'
- 'v*'
- 'private/**'
paths:
- hostplumber/**

jobs:
buildx:
env:
USERNAME: ${{ secrets.QUAY_USERNAME }}
PASSWORD: ${{ secrets.QUAY_PASSWORD }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup Docker BuildX
uses: docker/setup-buildx-action@v1

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

# setup Docker buld action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to the Quay Registry
uses: docker/login-action@v1
with:
registry: quay.io
username: ${{ env.USERNAME }}
password: ${{ env.PASSWORD }}

- name: Build/Push image to Quay Container Registry
run:
TEAMCITY_BUILD_ID=${{ github.run_number }}
make -C hostplumber img-build-push
1 change: 0 additions & 1 deletion hostplumber/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ COPY go.sum go.sum
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download

# Copy the go source
COPY main.go main.go
COPY api/ api/
Expand Down
3 changes: 1 addition & 2 deletions hostplumber/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SHELL=/bin/bash
# Image URL to use all building/pushing image targets
VER_LABEL=$(shell ../get-label.bash)
IMG ?= platform9/hostplumber:$(VER_LABEL)
IMG ?= quay.io/platform9/hostplumber:$(VER_LABEL)
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.27

Expand Down Expand Up @@ -152,7 +152,6 @@ img-build: $(BUILD_DIR) img-test
docker build --network host . -t ${IMG}

img-build-push: img-build docker-push
docker login
docker push ${IMG}
echo ${IMG} >> $(BUILD_DIR)/container-tag

Expand Down

0 comments on commit bfc6626

Please sign in to comment.