From 4b1a84a08ee54209bcdbfaac02defed48db498b1 Mon Sep 17 00:00:00 2001 From: "Shao Yu-Lung (Allen)" Date: Tue, 20 Apr 2021 21:34:46 +0800 Subject: [PATCH 1/7] update ci --- .github/workflows/dockerimage.yml | 37 ++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/.github/workflows/dockerimage.yml b/.github/workflows/dockerimage.yml index 30695ed..1321577 100644 --- a/.github/workflows/dockerimage.yml +++ b/.github/workflows/dockerimage.yml @@ -17,15 +17,30 @@ 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: Checkout + uses: actions/checkout@v2 + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + with: + platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7,linux/arm/v6 + - name: Build and push + uses: docker/build-push-action@v2 + with: + file: Dockerfile-${{ matrix.php_version }} + push: false + tags: laradock/php-fpm:${{ matrix.php_version }} + - name: check + run: | + 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: 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 From 9d9d593564714495fbce748c5a6cb4c00fc0c685 Mon Sep 17 00:00:00 2001 From: "Shao Yu-Lung (Allen)" Date: Tue, 20 Apr 2021 21:45:58 +0800 Subject: [PATCH 2/7] update ci --- .github/workflows/dockerimage.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dockerimage.yml b/.github/workflows/dockerimage.yml index 1321577..bef8930 100644 --- a/.github/workflows/dockerimage.yml +++ b/.github/workflows/dockerimage.yml @@ -19,16 +19,21 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + - name: Set up QEMU uses: docker/setup-qemu-action@v1 - with: - platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7,linux/arm/v6 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - 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: false tags: laradock/php-fpm:${{ matrix.php_version }} + - name: check run: | docker image ls From 092d0fede6932c73c24667f9aa836e767cd551fc Mon Sep 17 00:00:00 2001 From: "Shao Yu-Lung (Allen)" Date: Tue, 20 Apr 2021 22:09:29 +0800 Subject: [PATCH 3/7] update ci --- .github/workflows/dockerimage.yml | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/.github/workflows/dockerimage.yml b/.github/workflows/dockerimage.yml index bef8930..08242a1 100644 --- a/.github/workflows/dockerimage.yml +++ b/.github/workflows/dockerimage.yml @@ -26,26 +26,20 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 + - name: Login to Docker Hub + 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: false - tags: laradock/php-fpm:${{ matrix.php_version }} + push: ${{ (github.repository == 'laradock/php-fpm') && (github.ref == 'refs/heads/master') }} + tags: laradock/php-fpm:${{ env.TAG_PREFIX }}-${{ matrix.php_version }} - name: check run: | docker image ls - - - 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 From 91f6d8e2d8b36e118cfb900cd47fc39621faa7c8 Mon Sep 17 00:00:00 2001 From: "Shao Yu-Lung (Allen)" Date: Tue, 20 Apr 2021 22:10:48 +0800 Subject: [PATCH 4/7] update ci --- .github/workflows/dockerimage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dockerimage.yml b/.github/workflows/dockerimage.yml index 08242a1..68e9945 100644 --- a/.github/workflows/dockerimage.yml +++ b/.github/workflows/dockerimage.yml @@ -37,7 +37,7 @@ jobs: 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') }} + push: (${{ (github.repository == 'laradock/php-fpm') && (github.ref == 'refs/heads/master') }}) tags: laradock/php-fpm:${{ env.TAG_PREFIX }}-${{ matrix.php_version }} - name: check From 65c5490616866e7b64b341a307d75f2d035532da Mon Sep 17 00:00:00 2001 From: Shao Yu Lung Date: Wed, 21 Apr 2021 11:55:18 +0800 Subject: [PATCH 5/7] update ci --- .github/workflows/dockerimage.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dockerimage.yml b/.github/workflows/dockerimage.yml index 68e9945..6eff1bd 100644 --- a/.github/workflows/dockerimage.yml +++ b/.github/workflows/dockerimage.yml @@ -20,6 +20,19 @@ jobs: - 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=ref,event=branch + type=ref,event=tag + type=raw,value=latest + - name: Set up QEMU uses: docker/setup-qemu-action@v1 @@ -27,6 +40,7 @@ jobs: 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 }} @@ -37,8 +51,8 @@ jobs: 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: laradock/php-fpm:${{ env.TAG_PREFIX }}-${{ matrix.php_version }} + push: ${{ (github.repository == 'laradock/php-fpm') && (github.ref == 'refs/heads/master') }} + tags: ${{ steps.meta.outputs.tags }} - name: check run: | From 1f1fa30d69376811572de7511a0a032b7d5efd94 Mon Sep 17 00:00:00 2001 From: "Shao Yu-Lung (Allen)" Date: Wed, 21 Apr 2021 12:29:31 +0800 Subject: [PATCH 6/7] meta change tags --- .github/workflows/dockerimage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dockerimage.yml b/.github/workflows/dockerimage.yml index 6eff1bd..8dd2c1b 100644 --- a/.github/workflows/dockerimage.yml +++ b/.github/workflows/dockerimage.yml @@ -30,7 +30,7 @@ jobs: suffix=-${{ matrix.php_version }} tags: | type=ref,event=branch - type=ref,event=tag + type=semver,pattern={{version}} type=raw,value=latest - name: Set up QEMU From 7999e41884aa16c5ff92605e3166574979bfbdcc Mon Sep 17 00:00:00 2001 From: "Shao Yu-Lung (Allen)" Date: Wed, 21 Apr 2021 12:31:10 +0800 Subject: [PATCH 7/7] meta tags add schedule type --- .github/workflows/dockerimage.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/dockerimage.yml b/.github/workflows/dockerimage.yml index 8dd2c1b..b411e53 100644 --- a/.github/workflows/dockerimage.yml +++ b/.github/workflows/dockerimage.yml @@ -29,6 +29,7 @@ jobs: flavor: | suffix=-${{ matrix.php_version }} tags: | + type=schedule,pattern={{date 'YYYYMMDD'}} type=ref,event=branch type=semver,pattern={{version}} type=raw,value=latest