Skip to content

Commit

Permalink
feat: use ghcr.io instead of docker hub
Browse files Browse the repository at this point in the history
  • Loading branch information
incubator4 committed Aug 28, 2024
1 parent 6a9596a commit 970e660
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,18 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: rss3/${{ matrix.image }}
images: ghcr.io/${{ github.repository }}/${{ matrix.image }}

- name: Build and push by digest
id: build
Expand All @@ -58,7 +59,7 @@ jobs:
file: ./${{ matrix.image }}/Dockerfile
platforms: ${{ matrix.platform }}
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,name=rss3/${{ matrix.image }},push-by-digest=true,name-canonical=true,push=true
outputs: type=image,name=ghcr.io/${{ github.repository }}/${{ matrix.image }},push-by-digest=true,name-canonical=true,push=true
- name: Export digest
run: |
mkdir -p /tmp/digests/${{ matrix.image }}
Expand Down Expand Up @@ -125,8 +126,8 @@ jobs:
working-directory: /tmp/digests/${{ matrix.image }}
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf 'rss3/${{ matrix.image }}@sha256:%s ' *)
$(printf 'ghcr.io/${{ github.repository }}/${{ matrix.image }}@sha256:%s ' *)
- name: Inspect image
if: github.event_name != 'pull_request'
run: |
docker buildx imagetools inspect rss3/${{ matrix.image }}:${{ steps.meta.outputs.version }}
docker buildx imagetools inspect ghcr.io/${{ github.repository }}/${{ matrix.image }}:${{ steps.meta.outputs.version }}

0 comments on commit 970e660

Please sign in to comment.