From d18abe076e70bcede21bfaa1c562f70c4545767a Mon Sep 17 00:00:00 2001 From: Erhhung Yuan Date: Mon, 19 Aug 2024 12:30:54 -0700 Subject: [PATCH] Try tagging without docker.io/ --- .github/workflows/build.yml | 7 +++---- .github/workflows/ci.yml | 13 ++++++------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9d6327c..3af3c1c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,7 @@ jobs: - name: Set Environment Variables id: env - run: | + run: |- platform=${{ inputs.platform }} cat <> $GITHUB_ENV PLATFORM_PAIR=${platform//\//-} @@ -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 }} @@ -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 }} @@ -121,7 +120,7 @@ jobs: # create 0-byte file named /tmp/digests/ - name: Export Digest id: export - run: | + run: |- digest="${{ steps.build.outputs.digest }}" [ "$digest" ] || exit 1 mkdir -p /tmp/digests diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6f5066c..2663185 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -69,7 +69,7 @@ jobs: - name: Prepare Job Output Values id: output - run: | + run: |- csv="self-hosted,${{ steps.runner.outputs.labels }}" cat <> $GITHUB_OUTPUT labels-csv=$csv @@ -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 }} @@ -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 }} @@ -156,7 +155,7 @@ 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[@]}" @@ -164,7 +163,7 @@ jobs: # confirm merged image manifests - name: Inspect Image id: inspect - run: | + run: |- tag="${{ github.repository }}:$DOCKER_METADATA_OUTPUT_VERSION" docker buildx imagetools inspect $tag