Skip to content

Commit

Permalink
Merge pull request #56 from laradock/multi-platform
Browse files Browse the repository at this point in the history
publish images supported multi platform
  • Loading branch information
bestlong authored Apr 21, 2021
2 parents 3573bcb + 7999e41 commit 6dba94f
Showing 1 changed file with 41 additions and 12 deletions.
53 changes: 41 additions & 12 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,44 @@ jobs:
matrix:
php_version: ["5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0"]
steps:
- uses: actions/checkout@v2
- name: Build the Docker image
run: |
docker build . --file Dockerfile-${{ matrix.php_version }} --tag laradock/php-fpm:${{ env.TAG_PREFIX }}-${{ matrix.php_version }}
docker image ls
- name: Push image to Docker hub
if: ${{ success() && (github.repository == 'laradock/php-fpm') && (github.ref == 'refs/heads/master') }}
run: |
echo ${{ secrets.DOCKER_HUB_PASSWORD }} | docker login -u ${{ secrets.DOCKER_HUB_USER }} --password-stdin
docker push laradock/php-fpm:${{ env.TAG_PREFIX }}-${{ matrix.php_version }}
docker logout
- name: Checkout
uses: actions/checkout@v2

- name: Docker meta
id: meta
uses: crazy-max/ghaction-docker-meta@v2
with:
images:
laradock/php-fpm
flavor: |
suffix=-${{ matrix.php_version }}
tags: |
type=schedule,pattern={{date 'YYYYMMDD'}}
type=ref,event=branch
type=semver,pattern={{version}}
type=raw,value=latest
- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to Docker Hub
if: ${{ (github.repository == 'laradock/php-fpm') && (github.ref == 'refs/heads/master') }}
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}

- name: Build and push
uses: docker/build-push-action@v2
with:
file: Dockerfile-${{ matrix.php_version }}
platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7,linux/arm/v6
push: ${{ (github.repository == 'laradock/php-fpm') && (github.ref == 'refs/heads/master') }}
tags: ${{ steps.meta.outputs.tags }}

- name: check
run: |
docker image ls

0 comments on commit 6dba94f

Please sign in to comment.