From 997119cdcf7f35f3a57e719031fbb8158b55d85b Mon Sep 17 00:00:00 2001 From: Dedy Martadinata S Date: Fri, 29 Dec 2023 00:23:57 +0700 Subject: [PATCH] switch up build steps (#776) * switch up build steps * also swith the buildx --- .github/workflows/docker-build-static.yml | 94 +++++++++++------------ 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/.github/workflows/docker-build-static.yml b/.github/workflows/docker-build-static.yml index 317ba16..2c2f127 100644 --- a/.github/workflows/docker-build-static.yml +++ b/.github/workflows/docker-build-static.yml @@ -530,39 +530,6 @@ jobs: #### build variants docker image #### ##################################### - - name: Docker ${{ matrix.container }} meta - id: meta-standard - uses: docker/metadata-action@v5 - with: - # list of Docker images to use as base name for tags - images: | - nitnelave/lldap - lldap/lldap - ghcr.io/lldap/lldap - # Wanted Docker tags - # vX-alpine - # vX.Y-alpine - # vX.Y.Z-alpine - # latest - # latest-alpine - # stable - # stable-alpine - # YYYY-MM-DD - # YYYY-MM-DD-alpine - ################# - # vX-debian - # vX.Y-debian - # vX.Y.Z-debian - # latest-debian - # stable-debian - # YYYY-MM-DD-debian - ################# - # Check matrix for tag list definition - flavor: | - latest=false - suffix=-${{ matrix.container }} - tags: ${{ matrix.tags }} - - name: Docker ${{ matrix.container }}-rootless meta id: meta-rootless uses: docker/metadata-action@v5 @@ -596,6 +563,39 @@ jobs: suffix=-${{ matrix.container }}-rootless tags: ${{ matrix.tags }} + - name: Docker ${{ matrix.container }} meta + id: meta-standard + uses: docker/metadata-action@v5 + with: + # list of Docker images to use as base name for tags + images: | + nitnelave/lldap + lldap/lldap + ghcr.io/lldap/lldap + # Wanted Docker tags + # vX-alpine + # vX.Y-alpine + # vX.Y.Z-alpine + # latest + # latest-alpine + # stable + # stable-alpine + # YYYY-MM-DD + # YYYY-MM-DD-alpine + ################# + # vX-debian + # vX.Y-debian + # vX.Y.Z-debian + # latest-debian + # stable-debian + # YYYY-MM-DD-debian + ################# + # Check matrix for tag list definition + flavor: | + latest=false + suffix=-${{ matrix.container }} + tags: ${{ matrix.tags }} + # Docker login to nitnelave/lldap and lldap/lldap - name: Login to Nitnelave/LLDAP Docker Hub if: github.event_name != 'pull_request' @@ -612,20 +612,6 @@ jobs: username: nitnelave password: ${{ secrets.GITHUB_TOKEN }} - - name: Build ${{ matrix.container }} Docker Image - uses: docker/build-push-action@v5 - with: - context: . - push: ${{ github.event_name != 'pull_request' }} - platforms: ${{ matrix.platforms }} - file: ./.github/workflows/Dockerfile.ci.${{ matrix.container }} - tags: | - ${{ steps.meta-standard.outputs.tags }} - labels: ${{ steps.meta-standard.outputs.labels }} - cache-from: type=gha,mode=max - cache-to: type=gha,mode=max - - - name: Build ${{ matrix.container }}-rootless Docker Image uses: docker/build-push-action@v5 with: @@ -639,6 +625,20 @@ jobs: cache-from: type=gha,mode=max cache-to: type=gha,mode=max +### This docker build always the last, due :latest tag pushed multiple times, for whatever variants may added in future add docker build above this + - name: Build ${{ matrix.container }} Docker Image + uses: docker/build-push-action@v5 + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + platforms: ${{ matrix.platforms }} + file: ./.github/workflows/Dockerfile.ci.${{ matrix.container }} + tags: | + ${{ steps.meta-standard.outputs.tags }} + labels: ${{ steps.meta-standard.outputs.labels }} + cache-from: type=gha,mode=max + cache-to: type=gha,mode=max + - name: Update repo description if: github.event_name != 'pull_request' uses: peter-evans/dockerhub-description@v3