From a5e8cd00d54926918136fd631110871356e430d8 Mon Sep 17 00:00:00 2001 From: Demin Yin Date: Mon, 30 Dec 2024 13:10:50 -0800 Subject: [PATCH] add CI jobs to build platform-based images manually (#56) * build nightly images manually (for testing purposes) * build nightly images manually from branch "platforms" * update variables in CI --- .../manually_build_nightly_alpine_images.yml | 40 ++++++++++++++++++ .../manually_build_nightly_dev_images.yml | 41 +++++++++++++++++++ .../manually_build_nightly_images.yml | 40 ++++++++++++++++++ 3 files changed, 121 insertions(+) create mode 100644 .github/workflows/manually_build_nightly_alpine_images.yml create mode 100644 .github/workflows/manually_build_nightly_dev_images.yml create mode 100644 .github/workflows/manually_build_nightly_images.yml diff --git a/.github/workflows/manually_build_nightly_alpine_images.yml b/.github/workflows/manually_build_nightly_alpine_images.yml new file mode 100644 index 00000000..93d8e1bb --- /dev/null +++ b/.github/workflows/manually_build_nightly_alpine_images.yml @@ -0,0 +1,40 @@ +name: Build Nightly Alpine Images Manually + +on: + push: + branches: + - platforms + workflow_dispatch: + +jobs: + build_nightly_images_manually: + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + php: ["8.1", "8.2", "8.3", "8.4"] + platform: ["linux/386", "linux/amd64", "linux/arm/v5", "linux/arm/v7", "linux/arm64/v8", "linux/mips64le", "linux/ppc64le", "linux/s390x"] + + steps: + - + name: Checkout + uses: actions/checkout@v4 + + - + name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - + name: Build and push Docker image phpswoole/swoole:php${{ matrix.php }}-alpine on ${{ matrix.platform }} + id: docker_build + uses: docker/build-push-action@v5 + with: + context: . + file: dockerfiles/nightly/php${{ matrix.php }}/alpine/Dockerfile + platforms: ${{ matrix.platform }} + push: false + tags: phpswoole/swoole:php${{ matrix.php }}-alpine diff --git a/.github/workflows/manually_build_nightly_dev_images.yml b/.github/workflows/manually_build_nightly_dev_images.yml new file mode 100644 index 00000000..b4d53504 --- /dev/null +++ b/.github/workflows/manually_build_nightly_dev_images.yml @@ -0,0 +1,41 @@ +name: Build Nightly Dev Images Manually + +on: + push: + branches: + - platforms + workflow_dispatch: + +jobs: + build_nightly_images_manually: + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + php: ["8.1", "8.2", "8.3", "8.4"] + platform: ["linux/386", "linux/amd64", "linux/arm/v5", "linux/arm/v7", "linux/arm64/v8", "linux/mips64le", "linux/ppc64le", "linux/s390x"] + + steps: + - + name: Checkout + uses: actions/checkout@v4 + + - + name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - + name: Build and push Docker image phpswoole/swoole:php${{ matrix.php }} on ${ matrix.platform }} + id: docker_build + uses: docker/build-push-action@v5 + with: + context: . + file: dockerfiles/nightly/php${{ matrix.php }}/cli/Dockerfile + platforms: ${{ matrix.platform }} + push: false + tags: phpswoole/swoole:php${{ matrix.php }}-dev + build-args: DEV_MODE=true diff --git a/.github/workflows/manually_build_nightly_images.yml b/.github/workflows/manually_build_nightly_images.yml new file mode 100644 index 00000000..5e603d3f --- /dev/null +++ b/.github/workflows/manually_build_nightly_images.yml @@ -0,0 +1,40 @@ +name: Build Nightly Images Manually + +on: + push: + branches: + - platforms + workflow_dispatch: + +jobs: + build_nightly_images_manually: + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + php: ["8.1", "8.2", "8.3", "8.4"] + platform: ["linux/386", "linux/amd64", "linux/arm/v5", "linux/arm/v7", "linux/arm64/v8", "linux/mips64le", "linux/ppc64le", "linux/s390x"] + + steps: + - + name: Checkout + uses: actions/checkout@v4 + + - + name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - + name: Build and push Docker image phpswoole/swoole:php${{ matrix.php }} on ${{ matrix.platform }} + id: docker_build + uses: docker/build-push-action@v5 + with: + context: . + file: dockerfiles/nightly/php${{ matrix.php }}/cli/Dockerfile + platforms: ${{ matrix.platform }} + push: false + tags: phpswoole/swoole:php${{ matrix.php }}