Skip to content

fix(workflow): use runners with different architectures instead of QEMU #12322

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Jun 23, 2025
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 31 additions & 11 deletions .github/workflows/push-dev-image-on-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,21 @@ on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
build-test-push:
strategy:
matrix:
include:
- runner: ubuntu-24.04
arch: amd64
- runner: ubuntu-24.04-arm
arch: arm64

runs-on: ${{ matrix.runner }}

env:
APISIX_DOCKER_TAG: master-debian-dev
ENV_OS_ARCH: ${{ matrix.arch }}
DOCKER_BUILDKIT: 1

steps:
- name: Check out the repo
Expand Down Expand Up @@ -48,21 +58,31 @@ jobs:
fi

- name: Login to Docker Hub
uses: docker/login-action@v3
if: github.ref == 'refs/heads/master'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set up QEMU
- name: Push apisix image to Docker Hub
if: github.ref == 'refs/heads/master'
uses: docker/setup-qemu-action@v1
run: |
make push-on-debian-dev

- name: Set up Docker Buildx
if: github.ref == 'refs/heads/master'
uses: docker/setup-buildx-action@v1
merge-tags:
needs: build-test-push
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Push apisix image to Docker Hub
if: github.ref == 'refs/heads/master'
- name: Check out the repo
uses: actions/checkout@v4

- name: Merge architecture-specific tags
run: |
make push-multiarch-dev-on-debian
make merge-dev-tags
26 changes: 15 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -497,23 +497,27 @@ ci-env-stop:
build-on-debian-dev:
@$(call func_echo_status, "$@ -> [ Start ]")
$(ENV_DOCKER) build -t $(ENV_APISIX_IMAGE_TAG_NAME)-debian-dev \
--build-arg TARGETARCH=$(ENV_OS_ARCH) \
--build-arg CODE_PATH=. \
--build-arg ENTRYPOINT_PATH=./docker/debian-dev/docker-entrypoint.sh \
--build-arg INSTALL_BROTLI=./docker/debian-dev/install-brotli.sh \
--build-arg CHECK_STANDALONE_CONFIG=./docker/utils/check_standalone_config.sh \
-f ./docker/debian-dev/Dockerfile .
@$(call func_echo_success_status, "$@ -> [ Done ]")

### push-multiarch-dev-on-debian : Push apache/apisix:dev image
.PHONY: push-multiarch-dev-on-debian
push-multiarch-dev-on-debian:
.PHONY: push-on-debian-dev
push-on-debian-dev:
@$(call func_echo_status, "$@ -> [ Start ]")
$(ENV_DOCKER) buildx build --network=host --push \
-t $(IMAGE_NAME):dev \
--platform linux/amd64,linux/arm64 \
--build-arg CODE_PATH=. \
--build-arg ENTRYPOINT_PATH=./docker/debian-dev/docker-entrypoint.sh \
--build-arg INSTALL_BROTLI=./docker/debian-dev/install-brotli.sh \
--build-arg CHECK_STANDALONE_CONFIG=./docker/utils/check_standalone_config.sh \
-f ./docker/debian-dev/Dockerfile .
$(ENV_DOCKER) tag $(ENV_APISIX_IMAGE_TAG_NAME)-debian-dev $(IMAGE_NAME):dev-$(ENV_OS_ARCH)
$(ENV_DOCKER) push $(IMAGE_NAME):dev-$(ENV_OS_ARCH)
@$(call func_echo_success_status, "$@ -> [ Done ]")

### merge-dev-tags : Merge architecture-specific dev tags into a single dev tag
.PHONY: merge-dev-tags
merge-dev-tags:
@$(call func_echo_status, "$@ -> [ Start ]")
$(ENV_DOCKER) manifest create $(IMAGE_NAME):dev \
$(IMAGE_NAME):dev-amd64 \
$(IMAGE_NAME):dev-arm64
$(ENV_DOCKER) manifest push $(IMAGE_NAME):dev
@$(call func_echo_success_status, "$@ -> [ Done ]")
Loading