|
9 | 9 | required: true |
10 | 10 | default: '' |
11 | 11 |
|
12 | | -env: |
13 | | - DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_ACCESSTOKEN }} |
14 | | - |
15 | 12 | jobs: |
16 | 13 | build: |
17 | 14 | name: Build Base Image |
@@ -41,14 +38,35 @@ jobs: |
41 | 38 | steps: |
42 | 39 | - name: Checkout code |
43 | 40 | uses: actions/checkout@v3 |
44 | | - - name: Build |
| 41 | + - name: Set up QEMU |
| 42 | + uses: docker/setup-qemu-action@v3 |
| 43 | + - name: Set up Docker Buildx |
| 44 | + uses: docker/setup-buildx-action@v3 |
| 45 | + - name: Login to Docker Hub |
| 46 | + uses: docker/login-action@v3 |
| 47 | + with: |
| 48 | + username: limingxinleo |
| 49 | + password: ${{ secrets.DOCKERHUB_ACCESSTOKEN }} |
| 50 | + - name: Build and export to Docker |
| 51 | + uses: docker/build-push-action@v5 |
| 52 | + with: |
| 53 | + context: ${{ matrix.php-version }}/alpine/base |
| 54 | + load: true |
| 55 | + tags: hyperf/hyperf:${{ matrix.php-version }}-alpine-v${{ matrix.alpine-version }}-base |
| 56 | + build-args: | |
| 57 | + "ALPINE_VERSION=${{ matrix.alpine-version }}" |
| 58 | + - name: Check |
45 | 59 | run: | |
46 | | - docker-compose build alpine-base |
47 | 60 | docker run --entrypoint php -v $PWD/tests/base:/opt/www hyperf/hyperf:${{ matrix.php-version }}-alpine-v${{ matrix.alpine-version }}-base /opt/www/openssl.php |
48 | | - - name: Push Images to Docker Hub |
| 61 | + - name: Push |
49 | 62 | if: ${{ github.event.inputs.event == 'publish' }} |
50 | | - run: | |
51 | | - docker login --username limingxinleo -p $DOCKERHUB_TOKEN |
52 | | - docker push hyperf/hyperf:${{ matrix.php-version }}-alpine-v${{ matrix.alpine-version }}-base |
| 63 | + uses: docker/build-push-action@v5 |
| 64 | + with: |
| 65 | + context: ${{ matrix.php-version }}/alpine/base |
| 66 | + push: true |
| 67 | + platforms: linux/amd64,linux/arm64 |
| 68 | + tags: hyperf/hyperf:${{ matrix.php-version }}-alpine-v${{ matrix.alpine-version }}-base |
| 69 | + build-args: | |
| 70 | + "ALPINE_VERSION=${{ matrix.alpine-version }}" |
53 | 71 |
|
54 | 72 |
|
0 commit comments