diff --git a/.github/workflows/hostplumber-multiarch-build-and-push.yml b/.github/workflows/hostplumber-multiarch-build-and-push.yml new file mode 100644 index 00000000..fb8ce0f5 --- /dev/null +++ b/.github/workflows/hostplumber-multiarch-build-and-push.yml @@ -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 diff --git a/hostplumber/Dockerfile b/hostplumber/Dockerfile index 428e5105..a9c33fba 100644 --- a/hostplumber/Dockerfile +++ b/hostplumber/Dockerfile @@ -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/ diff --git a/hostplumber/Makefile b/hostplumber/Makefile index 74143355..d78c1662 100755 --- a/hostplumber/Makefile +++ b/hostplumber/Makefile @@ -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 @@ -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