From a33711d777277b0c1ca9104c79a39c34cf316c51 Mon Sep 17 00:00:00 2001 From: shpookas Date: Tue, 4 Aug 2026 13:46:42 +0200 Subject: [PATCH] chore(ci): publish experiment tags to ghcr.io instead of Docker Hub Use GITHUB_TOKEN with packages:write, matching docker-images and release.yml. Co-authored-by: Cursor --- ...dockerhub-publish.yml => ghcr-publish.yml} | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) rename .github/workflows/{dockerhub-publish.yml => ghcr-publish.yml} (69%) diff --git a/.github/workflows/dockerhub-publish.yml b/.github/workflows/ghcr-publish.yml similarity index 69% rename from .github/workflows/dockerhub-publish.yml rename to .github/workflows/ghcr-publish.yml index b8deeae93..73dfa8be1 100644 --- a/.github/workflows/dockerhub-publish.yml +++ b/.github/workflows/ghcr-publish.yml @@ -1,18 +1,14 @@ -# Build and push docker.io/linkpool/erpc: from an arbitrary git ref. -# Used for canary/prod experiment tags (e.g. pin-near-tip-getblock-test9). +# Build and push ghcr.io/linkpoolio/erpc: from an arbitrary git ref. +# Uses GITHUB_TOKEN (packages:write) — same pattern as docker-images / release.yml. # -# Required repo secrets: -# DOCKERHUB_USERNAME — Docker Hub user with write to the `linkpool` org -# DOCKERHUB_TOKEN — access token for that user -# -# Run: Actions → "Publish to Docker Hub" → workflow_dispatch +# Run: Actions → "Publish to GHCR" → workflow_dispatch # tag: pin-near-tip-getblock-test9 # ref: feat/websocket-support -name: Publish to Docker Hub +name: Publish to GHCR concurrency: - group: dockerhub-publish-${{ github.event.inputs.tag }} + group: ghcr-publish-${{ github.event.inputs.tag }} cancel-in-progress: false on: @@ -35,6 +31,7 @@ on: permissions: contents: read + packages: write jobs: publish: @@ -53,18 +50,21 @@ jobs: set -euo pipefail SHA="$(git rev-parse HEAD)" SHORT="$(git rev-parse --short HEAD)" + REPO="${GITHUB_REPOSITORY,,}" echo "sha=${SHA}" >> "$GITHUB_OUTPUT" echo "short_sha=${SHORT}" >> "$GITHUB_OUTPUT" - echo "Building ref=${{ inputs.ref }} sha=${SHORT} → docker.io/linkpool/erpc:${{ inputs.tag }}" + echo "image=ghcr.io/${REPO}" >> "$GITHUB_OUTPUT" + echo "Building ref=${{ inputs.ref }} sha=${SHORT} → ghcr.io/${REPO}:${{ inputs.tag }}" - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Login to Docker Hub + - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push uses: docker/build-push-action@v6 @@ -74,7 +74,7 @@ jobs: push: true platforms: ${{ inputs.platforms }} tags: | - docker.io/linkpool/erpc:${{ inputs.tag }} + ${{ steps.meta.outputs.image }}:${{ inputs.tag }} build-args: | VERSION=${{ inputs.tag }} COMMIT_SHA=${{ steps.meta.outputs.short_sha }} @@ -83,4 +83,4 @@ jobs: - name: Print digest run: | - docker buildx imagetools inspect "docker.io/linkpool/erpc:${{ inputs.tag }}" + docker buildx imagetools inspect "${{ steps.meta.outputs.image }}:${{ inputs.tag }}"