pediatric-ai-scribe-v3/.github/workflows/docker-publish.yml
Daniel 7b39c6c615 CI: fix docker multi-arch crash + add one-click version-bump workflow
docker-publish.yml:
  - Dropped linux/arm64 from the platforms matrix. The amd64 GitHub-
    hosted runner builds arm64 under QEMU emulation, which fails at
    native argon2 compile with SIGILL (exit 132). Your production
    box is x86, so arm64 isn't needed. Add it back with a native
    ARM runner the day you deploy to ARM hardware.

version-bump.yml (new):
  - Manual Actions trigger. Click "Run workflow" → pick patch / minor /
    major (or type a custom X.Y.Z). The workflow computes the next
    semver from the current package.json version, updates all three
    version sites (package.json, mobile/package.json, Android
    versionName + versionCode), commits "Release vX.Y.Z", tags it,
    and pushes. The tag push then fires android-release.yml and
    docker-publish.yml automatically — APK + Docker image published
    with no local commands required.

Typical flow now:
  Actions → "Version bump & release" → Run workflow → patch
    ↓
  Bump + tag in ~5 s
    ↓
  Parallel: android APK build (~2 m), docker image push (~4 m)
    ↓
  Both assets show up on the new release; Obtanium + docker-hub
  subscribers see the update automatically.
2026-04-14 23:44:47 +02:00

62 lines
1.9 KiB
YAML

name: Build & Push Docker Image
on:
push:
tags: ['v*']
workflow_dispatch:
inputs:
tag:
description: 'Docker image tag (e.g. v8, latest)'
required: false
default: 'latest'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- 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: Extract version tag
id: meta
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "tag=${{ github.event.inputs.tag || 'latest' }}" >> $GITHUB_OUTPUT
else
echo "tag=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT
fi
- name: Build and Push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
danielonyejesi/pediatric-ai-scribe-v3:${{ steps.meta.outputs.tag }}
danielonyejesi/pediatric-ai-scribe-v3:latest
cache-from: type=gha
cache-to: type=gha,mode=max
# x86 only — argon2 native build fails under QEMU ARM64
# emulation on a GitHub-hosted amd64 runner (SIGILL / exit 132).
# Add linux/arm64 back with a native ARM runner when/if you
# actually deploy to ARM hardware.
platforms: linux/amd64
- name: Summary
run: |
echo "### Docker image published" >> $GITHUB_STEP_SUMMARY
echo "- \`danielonyejesi/pediatric-ai-scribe-v3:${{ steps.meta.outputs.tag }}\`" >> $GITHUB_STEP_SUMMARY
echo "- \`danielonyejesi/pediatric-ai-scribe-v3:latest\`" >> $GITHUB_STEP_SUMMARY