Skip to content

Commit

Permalink
let's try
Browse files Browse the repository at this point in the history
  • Loading branch information
YohannParis committed Apr 22, 2024
1 parent 11a7daa commit c80a4fc
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 25 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/image-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,21 @@
name: image-tag.yml
on:
workflow_call:
inputs:
image-name:
required: true
description: 'The name of the image to be built'
type: string
outputs:
tag:
description: 'The tag of the image to be built'
value: ${{ jobs.image-tag.outputs.tag }}
tagged-image-name:
description: 'The tagged name of the image to be built'
value: ${{ jobs.image-tag.outputs.name }}
jobs:
image-tag:
name: Define image tag
runs-on: ubuntu-22.04
outputs:
tag: ${{ steps.define.outputs.tag }}
name: ${{ steps.define.outputs.name }}
steps:
- id: define
run: |
Expand All @@ -25,5 +31,7 @@ jobs:
TAG=${{ github.ref_name }}
fi
fi
echo "${TAG,,}"
echo "tag=${TAG,,}" >> $GITHUB_OUTPUT
IMAGE=${{ inputs.image-name }}:${TAG,,}
echo "$IMAGE"
echo "name=$IMAGE" >> $GITHUB_OUTPUT
20 changes: 8 additions & 12 deletions .github/workflows/merge-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@ name: merge-images.yml
on:
workflow_call:
inputs:
image_name:
name:
required: true
description: 'The name of the image to be merged'
type: string
image_tag:
required: true
description: 'The tag of the image to be merged'
type: string

jobs:
merge-images:
Expand All @@ -27,10 +23,10 @@ jobs:

- name: Create, inspect and publish manifest
run: |
docker manifest create ${{ inputs.image_name }}:${{ inputs.image_tag }} \
--amend ${{ inputs.image_name }}:${{ inputs.image_tag }}--amd64 \
--amend ${{ inputs.image_name }}:${{ inputs.image_tag }}--arm64
docker manifest annotate --arch amd64 --os linux ${{ inputs.image_name }}:${{ inputs.image_tag }} ${{ inputs.image_name }}:${{ inputs.image_tag }}--amd64
docker manifest annotate --arch arm64 --os linux ${{ inputs.image_name }}:${{ inputs.image_tag }} ${{ inputs.image_name }}:${{ inputs.image_tag }}}--arm64
docker manifest inspect ${{ inputs.image_name }}:${{ inputs.image_tag }}
docker manifest push ${{ inputs.image_name }}:${{ inputs.image_tag }}
docker manifest create ${{ inputs.name }} \
--amend ${{ inputs.name }}--amd64 \
--amend ${{ inputs.name }}--arm64
docker manifest annotate --arch amd64 --os linux ${{ inputs.name }} ${{ inputs.name }}--amd64
docker manifest annotate --arch arm64 --os linux ${{ inputs.name }} ${{ inputs.name }}--arm64
docker manifest inspect ${{ inputs.name }}
docker manifest push ${{ inputs.name }}
14 changes: 7 additions & 7 deletions .github/workflows/publish-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ on:

jobs:
image-tag:
name: Create image tag
name: Get tagged image name
uses: ./.github/workflows/image-tag.yml
with:
image-name: ghcr.io/darpa-askem/hmi-client

amd64:
if: false
Expand Down Expand Up @@ -122,14 +124,12 @@ jobs:
tags: ghcr.io/darpa-askem/hmi-client:${{ needs.image-tag.outputs.tag }}--arm64

merge-images:
name: Merge into one manifest
name: Merge AMD64 and ARM64 images under one manifest
needs:
- image-tag
# - amd64
- amd64
# - arm64-macos
# - arm64-emulation
- arm64-emulation
uses: ./.github/workflows/merge-images.yml
with:
image_name: ghcr.io/darpa-askem/hmi-client
image_tag: ${{ needs.image-tag.outputs.tag }}
#secrets: inherit
name: ${{ needs.image-tag.outputs.tagged-image-name }}

0 comments on commit c80a4fc

Please sign in to comment.