Skip to content

Commit

Permalink
Try tagging without docker.io/
Browse files Browse the repository at this point in the history
  • Loading branch information
erhhung committed Aug 19, 2024
1 parent 6b0e178 commit d18abe0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

- name: Set Environment Variables
id: env
run: |
run: |-
platform=${{ inputs.platform }}
cat <<EOF >> $GITHUB_ENV
PLATFORM_PAIR=${platform//\//-}
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
uses: docker/metadata-action@v5
with:
images: |-
docker.io/${{ github.repository }}
${{ github.repository }}
ghcr.io/${{ github.repository }}
labels: ${{ inputs.image-labels }}

Expand All @@ -91,7 +91,6 @@ jobs:
id: docker-hub
uses: docker/login-action@v3
with:
registry: docker.io
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

Expand Down Expand Up @@ -121,7 +120,7 @@ jobs:
# create 0-byte file named /tmp/digests/<digest>
- name: Export Digest
id: export
run: |
run: |-
digest="${{ steps.build.outputs.digest }}"
[ "$digest" ] || exit 1
mkdir -p /tmp/digests
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ jobs:
subnet-id: ${{ vars.RUNNER_SUBNET_ID }}
security-group-id: ${{ vars.RUNNER_SECURITY_GROUP_ID }}
iam-role-name: ${{ vars.RUNNER_INSTANCE_ROLE_NAME }}
aws-resource-tags: >
aws-resource-tags: >-
[
{"Key": "Name", "Value": "github-runner-${{ env.RUN_INFO }}"},
{"Key": "GitHubRepo", "Value": "${{ github.repository }}"}
]
pre-runner-script: |
pre-runner-script: |-
hostname="runner-$(date '+%y%m%d%H%M')-${{ env.RUN_INFO }}" && \
hostnamectl set-hostname $hostname # host name == runner name
# iptables is required to set up Docker
Expand All @@ -69,7 +69,7 @@ jobs:
- name: Prepare Job Output Values
id: output
run: |
run: |-
csv="self-hosted,${{ steps.runner.outputs.labels }}"
cat <<EOF >> $GITHUB_OUTPUT
labels-csv=$csv
Expand Down Expand Up @@ -131,7 +131,7 @@ jobs:
uses: docker/metadata-action@v5
with:
images: |-
docker.io/${{ github.repository }}
${{ github.repository }}
ghcr.io/${{ github.repository }}
labels: ${{ env.IMAGE_LABELS }}

Expand All @@ -140,7 +140,6 @@ jobs:
id: docker-hub
uses: docker/login-action@v3
with:
registry: docker.io
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

Expand All @@ -156,15 +155,15 @@ jobs:
- name: Create Manifests and Push
id: manifests
working-directory: /tmp/digests
run: |
run: |-
tags=($(jq -cr '[.tags[] | "-t \(.)"] | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON"))
images=($(printf '${{ github.repository }}@sha256:%s ' *))
docker buildx imagetools create "${tags[@]}" "${images[@]}"
# confirm merged image manifests
- name: Inspect Image
id: inspect
run: |
run: |-
tag="${{ github.repository }}:$DOCKER_METADATA_OUTPUT_VERSION"
docker buildx imagetools inspect $tag
Expand Down

0 comments on commit d18abe0

Please sign in to comment.