Skip to content

Commit a84aaaa

Browse files
authored
chore(ci): add github manual workflow build-push-images.yaml (#1330)
add timeout to create-release-draft workflow add --force to docker buildx rm builder in Makefile Signed-off-by: Cheng Fang <cfang@redhat.com>
1 parent b6e7aed commit a84aaaa

File tree

5 files changed

+51
-3
lines changed

5 files changed

+51
-3
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: docker-build-and-push-images
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
runners:
6+
description: 'Runners to use (JSON array, e.g., ["ubuntu-latest", "ubuntu-24.04-arm"] or ["ubuntu-latest"])'
7+
required: true
8+
type: string
9+
default: '["ubuntu-latest", "ubuntu-24.04-arm"]'
10+
11+
jobs:
12+
build-push-images:
13+
name: Build and push images (${{ matrix.runner }})
14+
runs-on: ${{ matrix.runner }}
15+
timeout-minutes: 30
16+
strategy:
17+
matrix:
18+
runner: ${{ fromJSON(inputs.runners) }}
19+
steps:
20+
- name: Delete tool cache to preserve space
21+
run: rm -rf /opt/hostedtoolcache || true
22+
23+
- name: Checkout code
24+
uses: actions/checkout@v5
25+
26+
- name: Get version
27+
id: version
28+
run: |
29+
echo version=$(cat VERSION) >> $GITHUB_OUTPUT
30+
31+
- name: Setup Golang
32+
uses: actions/setup-go@v6
33+
with:
34+
go-version-file: go.mod
35+
36+
- name: Build and push image
37+
run: |
38+
set -ex
39+
docker login --username "${DOCKER_USERNAME}" --password "${DOCKER_PASSWORD}" quay.io
40+
IMAGE_TAG=v${{ steps.version.outputs.version }} make docker-build docker-push
41+
env:
42+
DOCKER_USERNAME: ${{ secrets.QUAY_USERNAME }}
43+
DOCKER_PASSWORD: ${{ secrets.QUAY_TOKEN }}

.github/workflows/create-release-draft.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release')
1313
name: Create release draft
1414
runs-on: ubuntu-latest
15+
timeout-minutes: 45
1516
steps:
1617
- name: Checkout code
1718
uses: actions/checkout@v5

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ FROM alpine:3.22
2020

2121
RUN apk update && \
2222
apk upgrade && \
23-
apk add --no-cache ca-certificates git openssh-client tini gpg gpg-agent && \
24-
(apk add --no-cache aws-cli || (apk add --no-cache python3 py3-pip && pip3 install --no-cache-dir --break-system-packages awscli)) && \
23+
apk add ca-certificates git openssh-client aws-cli tini gpg gpg-agent && \
2524
rm -rf /var/cache/apk/*
2625

2726
RUN mkdir -p /usr/local/bin
@@ -32,5 +31,6 @@ COPY --from=builder /src/argocd-image-updater/dist/argocd-image-updater /manager
3231
COPY hack/git-ask-pass.sh /usr/local/bin/git-ask-pass.sh
3332

3433
USER 1000
34+
WORKDIR /app
3535

3636
ENTRYPOINT ["/sbin/tini", "--", "/manager"]

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ docker-buildx: ## Build and push docker image for the manager for cross-platform
154154
- $(CONTAINER_TOOL) buildx create --name image-updater-builder
155155
$(CONTAINER_TOOL) buildx use image-updater-builder
156156
- $(CONTAINER_TOOL) buildx build --push --platform=$(PLATFORMS) --tag ${IMG} -f Dockerfile.cross .
157-
- $(CONTAINER_TOOL) buildx rm image-updater-builder
157+
- $(CONTAINER_TOOL) buildx rm --force image-updater-builder
158158
rm Dockerfile.cross
159159

160160
.PHONY: build-installer

docs/contributing/releasing.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ Once you are happy with the result, approve/merge the Pull Request.
4141
Merging the Pull Request will start an [automated release process](https://github.com/argoproj-labs/argocd-image-updater/blob/master/.github/workflows/create-release-draft.yaml) that will build all the artifacts
4242
and create a draft release.
4343

44+
The above workflow will also build and push multi-arch container images to
45+
[argocd-image-updater quay.io repository](https://quay.io/repository/argoprojlabs/argocd-image-updater). In case of workflow glitch and the images are not published,
46+
you can run workflow [docker-build-and-push-images](https://github.com/argoproj-labs/argocd-image-updater/blob/master/.github/workflows/build-push-images.yaml) in GitHub UI to build and publish the specified images.
47+
4448
## Publish the release
4549

4650
You should now have a draft release or Argo Image Updater with all required artifacts attached as binaries.

0 commit comments

Comments
 (0)