Skip to content

Commit 8a5a2d0

Browse files
committed
chore: Need login for manually trigger
1 parent b4930ee commit 8a5a2d0

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

.github/workflows/docker-publish.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ env:
2323
ALIYUN_REGISTRY: registry.ap-southeast-1.aliyuncs.com/mcp-ecosystem
2424
BUILDX_NO_DEFAULT_ATTESTATIONS: 1
2525
PUSH_LATEST: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
26+
SHOULD_LOGIN: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
2627

2728
jobs:
2829
build-and-push:
@@ -41,22 +42,22 @@ jobs:
4142
platforms: linux/amd64,linux/arm64
4243

4344
- name: Login to Docker Hub
44-
if: env.PUSH_LATEST == 'true'
45+
if: env.SHOULD_LOGIN == 'true'
4546
uses: docker/login-action@v3
4647
with:
4748
username: ${{ env.DOCKER_HUB_USERNAME }}
4849
password: ${{ secrets.DOCKER_HUB_TOKEN }}
4950

5051
- name: Login to GitHub Container Registry
51-
if: env.PUSH_LATEST == 'true'
52+
if: env.SHOULD_LOGIN == 'true'
5253
uses: docker/login-action@v3
5354
with:
5455
registry: ghcr.io
5556
username: ${{ github.actor }}
5657
password: ${{ secrets.GITHUB_TOKEN }}
5758

5859
- name: Login to Aliyun Container Registry
59-
if: env.PUSH_LATEST == 'true'
60+
if: env.SHOULD_LOGIN == 'true'
6061
uses: docker/login-action@v3
6162
with:
6263
registry: ${{ env.ALIYUN_REGISTRY }}

0 commit comments

Comments
 (0)