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.
This commit is contained in:
@@ -123,9 +123,7 @@ jobs:
|
|||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: |
|
images: ghcr.io/${{ github.repository }}
|
||||||
name=${{ github.repository }},enable=${{ github.event.repository.fork == false }}
|
|
||||||
ghcr.io/${{ github.repository }}
|
|
||||||
tags: |
|
tags: |
|
||||||
type=ref,event=branch
|
type=ref,event=branch
|
||||||
type=semver,pattern={{version}},enable=false
|
type=semver,pattern={{version}},enable=false
|
||||||
@@ -137,15 +135,8 @@ jobs:
|
|||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
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
|
- name: Login to GitHub Container Registry
|
||||||
if: github.event_name == 'push'
|
if: github.event_name != 'pull_request'
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
@@ -180,9 +171,7 @@ jobs:
|
|||||||
id: meta-hw
|
id: meta-hw
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: |
|
images: ghcr.io/${{ github.repository }}
|
||||||
name=${{ github.repository }},enable=${{ github.event.repository.fork == false }}
|
|
||||||
ghcr.io/${{ github.repository }}
|
|
||||||
flavor: |
|
flavor: |
|
||||||
suffix=-hardware,onlatest=true
|
suffix=-hardware,onlatest=true
|
||||||
latest=auto
|
latest=auto
|
||||||
@@ -197,15 +186,8 @@ jobs:
|
|||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
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
|
- name: Login to GitHub Container Registry
|
||||||
if: github.event_name == 'push'
|
if: github.event_name != 'pull_request'
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
@@ -235,9 +217,7 @@ jobs:
|
|||||||
id: meta-rk
|
id: meta-rk
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: |
|
images: ghcr.io/${{ github.repository }}
|
||||||
name=${{ github.repository }},enable=${{ github.event.repository.fork == false }}
|
|
||||||
ghcr.io/${{ github.repository }}
|
|
||||||
flavor: |
|
flavor: |
|
||||||
suffix=-rockchip,onlatest=true
|
suffix=-rockchip,onlatest=true
|
||||||
latest=auto
|
latest=auto
|
||||||
@@ -252,15 +232,8 @@ jobs:
|
|||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
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
|
- name: Login to GitHub Container Registry
|
||||||
if: github.event_name == 'push'
|
if: github.event_name != 'pull_request'
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
|
|||||||
Reference in New Issue
Block a user