Skip to content

Commit

Permalink
Do both builds in one job
Browse files Browse the repository at this point in the history
  • Loading branch information
rahearn committed Dec 16, 2024
1 parent 348741a commit e7fbec6
Showing 1 changed file with 42 additions and 42 deletions.
84 changes: 42 additions & 42 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit e7fbec6

Please sign in to comment.