diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 639e710..0ad64b6 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -2,14 +2,12 @@ name: Publish Docker image on: push: - branches: [main] tags: - 'v*' workflow_dispatch: permissions: contents: read - packages: write env: IMAGE_NAME: pichost @@ -31,44 +29,19 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Log in to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Log in to Docker Hub - if: env.DOCKERHUB_USERNAME != '' && env.DOCKERHUB_TOKEN != '' uses: docker/login-action@v3 with: username: ${{ env.DOCKERHUB_USERNAME }} password: ${{ env.DOCKERHUB_TOKEN }} - - name: Resolve image names - id: images - run: | - names="ghcr.io/${OWNER}/${IMAGE_NAME}" - if [ -n "${DOCKERHUB_USERNAME}" ]; then - names="${names} - ${DOCKERHUB_USERNAME}/${IMAGE_NAME}" - fi - { - echo "list<> "$GITHUB_OUTPUT" - env: - OWNER: ${{ github.repository_owner }} - - name: Extract metadata id: meta uses: docker/metadata-action@v5 with: - # Same tags for ghcr.io and Docker Hub: latest + 1.0.0 (no v prefix) - images: ${{ steps.images.outputs.list }} + images: ${{ env.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }} tags: | - type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }} + type=raw,value=latest type=semver,pattern={{version}} - name: Build and push diff --git a/README.en.md b/README.en.md index 8b8d908..3ab4c2b 100644 --- a/README.en.md +++ b/README.en.md @@ -63,7 +63,7 @@ cd PicHost docker compose up -d ``` -Default port: **6892**. Complete the setup wizard in the browser. Image: `muxui/pichost:latest` (fallback: `ghcr.io/o96u/pichost:latest`). +Default port: **6892**. Complete the setup wizard in the browser. Image: `muxui/pichost:latest`. ### Local development diff --git a/README.md b/README.md index 995e39e..1a56483 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ cd PicHost docker compose up -d ``` -默认端口 **6892**。浏览器打开后按引导创建管理员即可。镜像:`muxui/pichost:latest`(备用 `ghcr.io/o96u/pichost:latest`)。 +默认端口 **6892**。浏览器打开后按引导创建管理员即可。镜像:`muxui/pichost:latest`。 ### 本地开发 diff --git a/docker-compose.yml b/docker-compose.yml index a74ff93..5bd1773 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,8 +4,6 @@ services: # 飞牛 Docker 对 Docker Hub 的「更新镜像」支持更好 image: muxui/pichost:latest pull_policy: always - # 备用:GitHub Container Registry - # image: ghcr.io/O96u/pichost:latest container_name: pichost restart: unless-stopped ports: