-
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.
add docker raw output and docker merge for distrubted multi-arch builds
- Loading branch information
Showing
3 changed files
with
101 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: Mobilecoin Docker | ||
description: Standardized docker build and publish actions | ||
|
||
inputs: | ||
digest_artifact_prefix: | ||
description: Prefix for the artifact names to restore | ||
required: false | ||
default: "" | ||
flavor: | ||
description: New line separated list of docker meta flavor options | ||
required: false | ||
default: "latest=false" | ||
images: | ||
description: URL/Path to docker image registry | ||
default: "" | ||
required: false | ||
tags: | ||
description: New line separated list of tags for the docker image | ||
required: false | ||
default: "" | ||
username: | ||
description: docker registry user | ||
default: "" | ||
required: false | ||
password: | ||
description: docker registry password | ||
default: "" | ||
required: false | ||
|
||
outputs: | ||
tags: | ||
description: docker/meta-action tags | ||
value: ${{ steps.docker_meta.output.tags }} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Download digests | ||
uses: mobilecoinofficial/gh-actions/download-artifact@v0 | ||
with: | ||
path: /tmp/digests | ||
pattern: ${{ inputs.digest_artifact_prefix }}* | ||
merge-multiple: true | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Generate Docker Tags | ||
id: docker_meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
flavor: ${{ inputs.flavor }} | ||
images: ${{ inputs.images }} | ||
tags: ${{ inputs.tags }} | ||
|
||
- name: Login to DockerHub | ||
if: inputs.username && inputs.password | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ inputs.username }} | ||
password: ${{ inputs.password }} | ||
|
||
- name: Create manifest list and push | ||
shell: bash | ||
working-directory: /tmp/digests | ||
run: | | ||
# Grab the tags from metadata-action ENV with jq | ||
# Gather all the digests for the images pushed (names of empty files stored as artifacts) | ||
# Push a manifest (tag) with all the digests to dockerhub | ||
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ | ||
$(printf '${{ inputs.images }}@sha256:%s ' *) |
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,16 @@ | ||
name: Short SHA | ||
description: Just spit out the short SHA (7) of the commit. | ||
|
||
outputs: | ||
short_sha: | ||
description: Short SHA (7) of the commit | ||
value: ${{ steps.short_sha.outputs.sha }} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Get short SHA | ||
shell: bash | ||
id: short_sha | ||
run: | | ||
echo "sha=sha-${GITHUB_SHA::7}" >> "${GITHUB_OUTPUT}" |