From 9f5a4b2d9691ebdff879b4c0fa8f4f0950f5fe81 Mon Sep 17 00:00:00 2001 From: Sergey Krashevich Date: Fri, 6 Mar 2026 06:10:05 +0300 Subject: [PATCH] Publish to GHCR only; remove DockerHub logins Simplify CI container publishing by targeting only GitHub Container Registry. The docker/metadata-action images inputs for meta, meta-hw and meta-rk jobs were changed to ghcr.io/${{ github.repository }} (removing DockerHub image entries). DockerHub login steps were removed, and the GHCR login now runs for all non-pull_request events (if: github.event_name != 'pull_request'). Changes are in .github/workflows/build.yml to avoid pushing to DockerHub and ensure GHCR auth runs on appropriate events. --- .github/workflows/build.yml | 39 ++++++------------------------------- 1 file changed, 6 insertions(+), 33 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6015efa0..c372bb05 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -123,9 +123,7 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: | - name=${{ github.repository }},enable=${{ github.event.repository.fork == false }} - ghcr.io/${{ github.repository }} + images: ghcr.io/${{ github.repository }} tags: | type=ref,event=branch type=semver,pattern={{version}},enable=false @@ -137,15 +135,8 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Login to DockerHub - if: github.event_name == 'push' && github.event.repository.fork == false - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Login to GitHub Container Registry - if: github.event_name == 'push' + if: github.event_name != 'pull_request' uses: docker/login-action@v3 with: registry: ghcr.io @@ -180,9 +171,7 @@ jobs: id: meta-hw uses: docker/metadata-action@v5 with: - images: | - name=${{ github.repository }},enable=${{ github.event.repository.fork == false }} - ghcr.io/${{ github.repository }} + images: ghcr.io/${{ github.repository }} flavor: | suffix=-hardware,onlatest=true latest=auto @@ -197,15 +186,8 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Login to DockerHub - if: github.event_name == 'push' && github.event.repository.fork == false - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Login to GitHub Container Registry - if: github.event_name == 'push' + if: github.event_name != 'pull_request' uses: docker/login-action@v3 with: registry: ghcr.io @@ -235,9 +217,7 @@ jobs: id: meta-rk uses: docker/metadata-action@v5 with: - images: | - name=${{ github.repository }},enable=${{ github.event.repository.fork == false }} - ghcr.io/${{ github.repository }} + images: ghcr.io/${{ github.repository }} flavor: | suffix=-rockchip,onlatest=true latest=auto @@ -252,15 +232,8 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Login to DockerHub - if: github.event_name == 'push' && github.event.repository.fork == false - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Login to GitHub Container Registry - if: github.event_name == 'push' + if: github.event_name != 'pull_request' uses: docker/login-action@v3 with: registry: ghcr.io