chore: update publish image workflow
This commit is contained in:
parent
c6e505e924
commit
eb68ab6a23
30
.github/workflows/publish_github_docker.yml
vendored
30
.github/workflows/publish_github_docker.yml
vendored
@ -41,11 +41,7 @@ jobs:
|
|||||||
- name: Set Docker Tags
|
- name: Set Docker Tags
|
||||||
run: |
|
run: |
|
||||||
SANITIZED_REF=$(echo "$GIT_REF" | sed 's/\//-/g')
|
SANITIZED_REF=$(echo "$GIT_REF" | sed 's/\//-/g')
|
||||||
if [ "${{ github.ref_name }}" = "fazer-ai/main" ]; then
|
echo "SANITIZED_REF=${SANITIZED_REF}" >> $GITHUB_ENV
|
||||||
echo "GITHUB_TAG=${GITHUB_REPO}:latest" >> $GITHUB_ENV
|
|
||||||
else
|
|
||||||
echo "GITHUB_TAG=${GITHUB_REPO}:${SANITIZED_REF}" >> $GITHUB_ENV
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
@ -69,7 +65,9 @@ jobs:
|
|||||||
file: docker/Dockerfile
|
file: docker/Dockerfile
|
||||||
platforms: ${{ matrix.platform }}
|
platforms: ${{ matrix.platform }}
|
||||||
push: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
|
push: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
|
||||||
outputs: type=image,name=${{ env.GITHUB_TAG }},name-canonical=true,push=true
|
tags: |
|
||||||
|
${{ env.GITHUB_REPO }}:${{ env.SANITIZED_REF }}
|
||||||
|
${{ env.GITHUB_REPO }}:latest
|
||||||
|
|
||||||
- name: Export digest
|
- name: Export digest
|
||||||
run: |
|
run: |
|
||||||
@ -113,13 +111,9 @@ jobs:
|
|||||||
GIT_REF: ${{ github.head_ref || github.ref_name }}
|
GIT_REF: ${{ github.head_ref || github.ref_name }}
|
||||||
run: |
|
run: |
|
||||||
SANITIZED_REF=$(echo "$GIT_REF" | sed 's/\//-/g')
|
SANITIZED_REF=$(echo "$GIT_REF" | sed 's/\//-/g')
|
||||||
if [ "${{ github.ref_name }}" = "fazer-ai/main" ]; then
|
docker buildx imagetools create \
|
||||||
GITHUB_TAG="ghcr.io/${{ github.repository }}:latest"
|
-t ghcr.io/${{ github.repository }}:${SANITIZED_REF} \
|
||||||
else
|
-t ghcr.io/${{ github.repository }}:latest \
|
||||||
GITHUB_TAG="ghcr.io/${{ github.repository }}:${SANITIZED_REF}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
docker buildx imagetools create -t $GITHUB_TAG \
|
|
||||||
$(printf 'ghcr.io/${{ github.repository }}@sha256:%s ' *)
|
$(printf 'ghcr.io/${{ github.repository }}@sha256:%s ' *)
|
||||||
|
|
||||||
- name: Inspect image
|
- name: Inspect image
|
||||||
@ -127,10 +121,6 @@ jobs:
|
|||||||
GIT_REF: ${{ github.head_ref || github.ref_name }}
|
GIT_REF: ${{ github.head_ref || github.ref_name }}
|
||||||
run: |
|
run: |
|
||||||
SANITIZED_REF=$(echo "$GIT_REF" | sed 's/\//-/g')
|
SANITIZED_REF=$(echo "$GIT_REF" | sed 's/\//-/g')
|
||||||
if [ "${{ github.ref_name }}" = "fazer-ai/main" ]; then
|
REPO="ghcr.io/${{ github.repository }}"
|
||||||
GITHUB_TAG="ghcr.io/${{ github.repository }}:latest"
|
docker buildx imagetools inspect ${REPO}:${SANITIZED_REF}
|
||||||
else
|
docker buildx imagetools inspect ${REPO}:latest
|
||||||
GITHUB_TAG="ghcr.io/${{ github.repository }}:${SANITIZED_REF}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
docker buildx imagetools inspect $GITHUB_TAG
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user