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
86 changes: 86 additions & 0 deletions .github/workflows/dockerhub-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# 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).
#
# 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
# tag: pin-near-tip-getblock-test9
# ref: feat/websocket-support

name: Publish to Docker Hub

concurrency:
group: dockerhub-publish-${{ github.event.inputs.tag }}
cancel-in-progress: false

on:
workflow_dispatch:
inputs:
tag:
description: "Image tag to push (e.g. pin-near-tip-getblock-test9)"
required: true
type: string
ref:
description: "Git ref to build (branch, tag, or SHA)"
required: true
default: "feat/websocket-support"
type: string
platforms:
description: "Target platforms"
required: false
default: "linux/amd64"
type: string

permissions:
contents: read

jobs:
publish:
runs-on: ubuntu-24.04
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
fetch-depth: 1

- name: Set build metadata
id: meta
run: |
set -euo pipefail
SHA="$(git rev-parse HEAD)"
SHORT="$(git rev-parse --short HEAD)"
echo "sha=${SHA}" >> "$GITHUB_OUTPUT"
echo "short_sha=${SHORT}" >> "$GITHUB_OUTPUT"
echo "Building ref=${{ inputs.ref }} sha=${SHORT} → docker.io/linkpool/erpc:${{ inputs.tag }}"

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
platforms: ${{ inputs.platforms }}
tags: |
docker.io/linkpool/erpc:${{ inputs.tag }}
build-args: |
VERSION=${{ inputs.tag }}
COMMIT_SHA=${{ steps.meta.outputs.short_sha }}
provenance: false
sbom: false

- name: Print digest
run: |
docker buildx imagetools inspect "docker.io/linkpool/erpc:${{ inputs.tag }}"
Loading