Skip to content

Commit

Permalink
chore: fix Docker tagging logic in CI workflows
Browse files Browse the repository at this point in the history
- Remove default 'EDGE' tag from docker setup workflow.
- Simplify docker tags setup to use only current input tag or 'latest' if tag is 'dev'.
- Harmonize docker tag inputs across publish jobs by:
  - Using 'github.ref_name' instead of complex expression in main publish job.
  - Hardcode 'dev' tag in cron publish job.
  - Hardcode 'forge' tag for tag dispatch publish job.

Signed-off-by: 陳鈞 <[email protected]>
  • Loading branch information
jim60105 committed Mar 12, 2024
1 parent 12a3ec5 commit 25c22fb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/docker-reused-setup-steps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ inputs:
required: true
tag:
required: true
default: EDGE

outputs:
tags:
Expand Down Expand Up @@ -42,9 +41,8 @@ runs:
with:
images: ghcr.io/${{ github.repository_owner }}/stable-diffusion-webui
tags: |
dev,enable=${{ inputs.tag == 'master' }}
latest,enable=${{ inputs.tag == 'master' }}
${{ inputs.tag }},enable=${{ inputs.tag != 'master' }}
${{ inputs.tag }}
latest,enable=${{ inputs.tag == 'dev' }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docker_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
uses: ./.github/workflows/docker-reused-setup-steps
with:
CR_PAT: ${{ secrets.CR_PAT }}
tag: ${{ github.head_ref || github.ref_name }}
tag: ${{ github.ref_name }}

- name: Build and push
uses: docker/build-push-action@v5
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
uses: ./.github/workflows/docker-reused-setup-steps
with:
CR_PAT: ${{ secrets.CR_PAT }}
tag: ${{ github.head_ref || github.ref_name }}
tag: dev

- name: Build and push
uses: docker/build-push-action@v5
Expand Down Expand Up @@ -112,7 +112,7 @@ jobs:
uses: ./.github/workflows/docker-reused-setup-steps
with:
CR_PAT: ${{ secrets.CR_PAT }}
tag: ${{ github.head_ref || github.ref_name }}
tag: forge

- name: Build and push
uses: docker/build-push-action@v5
Expand Down

0 comments on commit 25c22fb

Please sign in to comment.