From bb028521f796369ce381bfa397f53430d02f60ab Mon Sep 17 00:00:00 2001 From: neil Date: Fri, 8 May 2026 21:05:55 +0200 Subject: [PATCH] ci: also push images to ghcr.io Publish each build to GitHub Container Registry alongside Docker Hub, so users can pull from ghcr.io/neilpang/letsproxy as well. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/dockerhub.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/dockerhub.yml b/.github/workflows/dockerhub.yml index 4b5b56e..519faea 100644 --- a/.github/workflows/dockerhub.yml +++ b/.github/workflows/dockerhub.yml @@ -8,6 +8,9 @@ on: jobs: multiarch-build-debian: runs-on: ubuntu-latest + permissions: + contents: read + packages: write steps: - name: Checkout @@ -21,6 +24,7 @@ jobs: with: images: | neilpang/letsproxy + ghcr.io/${{ github.repository_owner }}/letsproxy tags: | type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} type=ref,event=branch @@ -37,6 +41,13 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push the Debian based image id: docker_build_debian uses: docker/build-push-action@v6 @@ -52,6 +63,9 @@ jobs: multiarch-build-alpine: runs-on: ubuntu-latest + permissions: + contents: read + packages: write steps: - name: Checkout @@ -65,6 +79,7 @@ jobs: with: images: | neilpang/letsproxy + ghcr.io/${{ github.repository_owner }}/letsproxy tags: | type=raw,value=alpine,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} type=ref,suffix=-alpine,event=branch @@ -82,6 +97,13 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push the Alpine based image id: docker_build_alpine uses: docker/build-push-action@v6