Skip to content

Commit 225888c

Browse files
committed
Support build arm64 for dev images.
1 parent ae216f9 commit 225888c

File tree

1 file changed

+33
-5
lines changed

1 file changed

+33
-5
lines changed

.github/workflows/build-dev.yml

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,38 @@ jobs:
4848
default => substr($phpVersion, 0, 1)
4949
};
5050
echo "::set-output name=version::" . $version . PHP_EOL;
51-
- name: Build
52-
run: export PHP_BUILD_VERSION=${{ steps.fetch-php-build-version.outputs.version }} && docker-compose build alpine-dev
53-
- name: Login
54-
run: docker login --username limingxinleo -p ${{ secrets.DOCKERHUB_ACCESSTOKEN }}
51+
- name: Set up QEMU
52+
uses: docker/setup-qemu-action@v3
53+
- name: Set up Docker Buildx
54+
uses: docker/setup-buildx-action@v3
55+
- name: Login to Docker Hub
56+
uses: docker/login-action@v3
57+
with:
58+
username: limingxinleo
59+
password: ${{ secrets.DOCKERHUB_ACCESSTOKEN }}
60+
- name: Build and export to Docker
61+
uses: docker/build-push-action@v5
62+
with:
63+
context: ${{ matrix.php-version }}/alpine/dev
64+
load: true
65+
tags: hyperf/hyperf:${{ matrix.php-version }}-alpine-v${{ matrix.alpine-version }}-dev
66+
build-args: |
67+
"ALPINE_VERSION=${{ matrix.alpine-version }}"
68+
"COMPOSER_VERSION=${{ env.COMPOSER_VERSION }}"
69+
"PHP_BUILD_VERSION=${{ steps.fetch-php-build-version.outputs.version }}"
70+
- name: Check
71+
run: |
72+
docker run --entrypoint php hyperf/hyperf:${{ matrix.php-version }}-alpine-v${{ matrix.alpine-version }}-dev -v
5573
- name: Push
56-
run: docker push hyperf/hyperf:${PHP_VERSION}-alpine-v${{ matrix.alpine-version }}-dev
74+
if: ${{ github.ref == 'refs/heads/build' }}
75+
uses: docker/build-push-action@v5
76+
with:
77+
context: ${{ matrix.php-version }}/alpine/dev
78+
push: true
79+
platforms: linux/amd64,linux/arm64
80+
tags: hyperf/hyperf:${{ matrix.php-version }}-alpine-v${{ matrix.alpine-version }}-dev
81+
build-args: |
82+
"ALPINE_VERSION=${{ matrix.alpine-version }}"
83+
"COMPOSER_VERSION=${{ env.COMPOSER_VERSION }}"
84+
"PHP_BUILD_VERSION=${{ steps.fetch-php-build-version.outputs.version }}"
5785

0 commit comments

Comments
 (0)