Skip to content

Merge: relicense to MPL-2.0 + OIDC publish + socket.json (0.4.1) #50

Merge: relicense to MPL-2.0 + OIDC publish + socket.json (0.4.1)

Merge: relicense to MPL-2.0 + OIDC publish + socket.json (0.4.1) #50

# SPDX-License-Identifier: MPL-2.0
# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
#
# Container Publish workflow — builds and pushes the container image to
# GitHub Container Registry (ghcr.io) and Docker Hub on version tag push
# (v*) or manual dispatch. Uses the multi-stage Containerfile in container/.
name: Container Publish
on:
push:
tags:
- 'v*'
workflow_dispatch:
permissions: read-all
jobs:
build-and-push:
name: Build & Push Container Image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Log in to GitHub Container Registry
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to Docker Hub
if: env.DOCKERHUB_USERNAME != ''
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract version metadata
id: meta
run: |
VERSION="${GITHUB_REF_NAME#v}"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Build and push container image
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
with:
context: .
file: container/Containerfile
push: true
tags: |
ghcr.io/${{ github.repository }}:${{ steps.meta.outputs.version }}
ghcr.io/${{ github.repository }}:latest
${{ secrets.DOCKERHUB_USERNAME && format('docker.io/{0}/boj-server:{1}', secrets.DOCKERHUB_USERNAME, steps.meta.outputs.version) || '' }}
${{ secrets.DOCKERHUB_USERNAME && format('docker.io/{0}/boj-server:latest', secrets.DOCKERHUB_USERNAME) || '' }}
labels: |
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
org.opencontainers.image.description=Bundle of Joy MCP Server — 99 formally verified cartridges
org.opencontainers.image.licenses=MPL-2.0
org.opencontainers.image.version=${{ steps.meta.outputs.version }}