From e7fbec6a4bd13264f03c786a0c4d3f0f5b2d1eae Mon Sep 17 00:00:00 2001 From: Ryan Ahearn Date: Mon, 16 Dec 2024 14:09:16 -0500 Subject: [PATCH] Do both builds in one job --- .github/workflows/docker-publish.yml | 84 ++++++++++++++-------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 1e01633..e4afbde 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -49,6 +49,10 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Get today's date + id: today + run: echo "date=`date +'%Y%m%d'`" >> $GITHUB_OUTPUT + # Extract metadata (tags, labels) for Docker # https://github.com/docker/metadata-action - name: Extract Docker metadata @@ -58,7 +62,7 @@ jobs: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} flavor: latest=true tags: | - type=raw,value={{date 'YYYYMMDD'}},priority=850 + type=raw,value=${{ steps.today.outputs.date }},priority=850 type=ref,event=branch type=sha @@ -92,42 +96,42 @@ jobs: run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST} - build-glr: - needs: build - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - # This is used to complete the identity challenge - # with sigstore/fulcio when running outside of PRs. - id-token: write - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - # Install the cosign tool except on PR - # https://github.com/sigstore/cosign-installer - - name: Install cosign - if: github.event_name != 'pull_request' - uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 #v3.5.0 - with: - cosign-release: 'v2.2.4' - - # Set up BuildKit Docker container builder to be able to build - # multi-platform images and export cache - # https://github.com/docker/setup-buildx-action - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0 - - # Login against a Docker registry except on PR - # https://github.com/docker/login-action - - name: Log into registry ${{ env.REGISTRY }} - if: github.event_name != 'pull_request' - uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + # build-glr: + # needs: build + # runs-on: ubuntu-latest + # permissions: + # contents: read + # packages: write + # # This is used to complete the identity challenge + # # with sigstore/fulcio when running outside of PRs. + # id-token: write + # steps: + # - name: Checkout repository + # uses: actions/checkout@v4 + + # # Install the cosign tool except on PR + # # https://github.com/sigstore/cosign-installer + # - name: Install cosign + # if: github.event_name != 'pull_request' + # uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 #v3.5.0 + # with: + # cosign-release: 'v2.2.4' + + # # Set up BuildKit Docker container builder to be able to build + # # multi-platform images and export cache + # # https://github.com/docker/setup-buildx-action + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0 + + # # Login against a Docker registry except on PR + # # https://github.com/docker/login-action + # - name: Log into registry ${{ env.REGISTRY }} + # if: github.event_name != 'pull_request' + # uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 + # with: + # registry: ${{ env.REGISTRY }} + # username: ${{ github.actor }} + # password: ${{ secrets.GITHUB_TOKEN }} - name: Extract Docker metadata - glr variant id: meta-glr @@ -136,11 +140,7 @@ jobs: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} flavor: latest=false tags: | - type=raw,value={{date 'YYYYMMDD'}}-glr,priority=840 - - - name: Get today's date - id: today - run: echo "date=`date +'%Y%m%d'`" >> $GITHUB_OUTPUT + type=raw,value=${{ steps.today.outputs.date }}-glr,priority=840 - name: Build and push Docker image - glr variant id: build-and-push-glr