This commit is contained in:
YuCat-OVO 2024-03-02 19:51:39 +08:00
parent eba4a9dffa
commit f9043326fc

View File

@ -46,7 +46,7 @@ jobs:
with:
images: |
${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}
# ghcr.io/${{ github.repository }}
ghcr.io/${{ github.repository }}
tags: |
type=raw,value=${{ steps.set-vars.outputs.VERSION }}
type=raw,value=${{ steps.set-vars.outputs.BRACH }}
@ -64,12 +64,12 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
# - name: Login to GHCR
# uses: docker/login-action@v3
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push by digest
id: build
@ -127,11 +127,13 @@ jobs:
GITHUB_REF=${{ github.ref }}
BRACH=${GITHUB_REF#refs/heads/}
DATE=$(date '+%Y-%m-%dT%H:%M:%S%Z')
ACTOR=${{ github.actor }}
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
echo "GITHUB_REF=${GITHUB_REF}" >> $GITHUB_OUTPUT
echo "BRACH=${BRACH}" >> $GITHUB_OUTPUT
echo "DATE=${DATE}" >> $GITHUB_OUTPUT
echo "ACTOR=${ACTOR,,}" >> $GITHUB_OUTPUT
- name: Download digests
uses: actions/download-artifact@v4
@ -149,7 +151,7 @@ jobs:
with:
images: |
${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}
# ghcr.io/${{ github.repository }}
ghcr.io/${{ github.repository }}
tags: |
type=raw,value=${{ steps.set-vars.outputs.VERSION }}
type=raw,value=${{ steps.set-vars.outputs.BRACH }}
@ -161,19 +163,21 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
# - name: Login to GHCR
# uses: docker/login-action@v3
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create manifest list and push
working-directory: /tmp/digests
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}@sha256:%s ' *)
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf 'ghcr.io/${{ steps.set-vars.outputs.ACTOR }}/${{ env.IMAGE_NAME }}@sha256:%s ' *)
- name: Inspect image
run: |
docker buildx imagetools inspect $${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }}
docker buildx imagetools inspect ${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }}