Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
# Build and push docker.io/linkpool/erpc:<tag> 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:<tag> 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:
Expand All @@ -35,6 +31,7 @@ on:

permissions:
contents: read
packages: write

jobs:
publish:
Expand All @@ -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
Expand All @@ -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 }}
Expand All @@ -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 }}"
Loading