-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(update-docker-manifest): create main distro manifest (autowarefoun…
…dation#335) * ci(update-docker-manifest): create main distro manifest Signed-off-by: Kenji Miyake <[email protected]> * fix grep Signed-off-by: Kenji Miyake <[email protected]> * add latest-prebuilt Signed-off-by: Kenji Miyake <[email protected]>
- Loading branch information
1 parent
acf4ac6
commit 56b9dc9
Showing
3 changed files
with
78 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: create-main-distro-alias | ||
description: "" | ||
|
||
inputs: | ||
package-name: | ||
description: "" | ||
required: true | ||
rosdistro: | ||
description: "" | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ github.token }} | ||
|
||
- name: Set image name | ||
id: set-image-name | ||
run: echo "::set-output name=image-name::ghcr.io/${{ github.repository_owner }}/${{ inputs.package-name }}" | ||
shell: bash | ||
|
||
- name: Create Docker manifest for latest | ||
run: | | ||
# Check image existence | ||
distro_image="${{ steps.set-image-name.outputs.image-name }}:${{ inputs.rosdistro }}-latest" | ||
if docker manifest inspect "$distro_image-amd64" >/dev/null 2>&1; then | ||
amd64_image="$distro_image-amd64" | ||
fi | ||
if docker manifest inspect "$distro_image-arm64" >/dev/null 2>&1; then | ||
amd64_image="$distro_image-arm64" | ||
fi | ||
echo "amd64_image: $amd64_image" | ||
echo "arm64_image: $arm64_image" | ||
docker manifest create --amend ${{ steps.set-image-name.outputs.image-name }}:latest \ | ||
$amd64_image \ | ||
$arm64_image | ||
docker manifest push ${{ steps.set-image-name.outputs.image-name }}:latest | ||
shell: bash | ||
|
||
- name: Create Docker manifest for latest-prebuilt | ||
run: | | ||
# Check image existence | ||
distro_image="${{ steps.set-image-name.outputs.image-name }}:${{ inputs.rosdistro }}-latest-prebuilt" | ||
if docker manifest inspect "$distro_image-amd64" >/dev/null 2>&1; then | ||
amd64_image="$distro_image-amd64" | ||
fi | ||
if docker manifest inspect "$distro_image-arm64" >/dev/null 2>&1; then | ||
amd64_image="$distro_image-arm64" | ||
fi | ||
echo "amd64_image: $amd64_image" | ||
echo "arm64_image: $arm64_image" | ||
docker manifest create --amend ${{ steps.set-image-name.outputs.image-name }}:latest-prebuilt \ | ||
$amd64_image \ | ||
$arm64_image | ||
docker manifest push ${{ steps.set-image-name.outputs.image-name }}:latest-prebuilt | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters