Skip to content

Speakr is a personal, self-hosted web application designed for transcribing audio recordings

Python

Move Docker image publishing to GitHub Actions on published release for public build provenance and make the Forgejo publish workflow a manual fallback

Murtaza Nasir659a08d68c86
diff --git a/.forgejo/workflows/docker-publish.yml b/.forgejo/workflows/docker-publish.yml
index d5aa4811..d3cc4d4c 100644
--- a/.forgejo/workflows/docker-publish.yml
+++ b/.forgejo/workflows/docker-publish.yml
@@ -1,21 +1,20 @@
name: Publish to Docker Hub
-# Publish step, kept separate from CI. The "Tests" workflow runs on every
-# push/PR; this one does NOT run on ordinary pushes. It publishes when you
-# create a version tag (deliberate "cut a release" act) and can also be run by
-# hand from the Actions tab. Building/pushing the multi-arch images needs the
-# DOCKERHUB_USERNAME / DOCKERHUB_TOKEN repo secrets.
-#
-# git tag v0.6.0 && git push forgejo v0.6.0 -> publishes :v0.6.0
+# Publish step, kept separate from CI. Tag-push publishing is now owned by the
+# GitHub workflow (.github/workflows/docker-publish.yml fires on a published
+# Release) so release images are built on public runners with auditable logs and
+# provenance. This Forgejo workflow is a MANUAL fallback only: run it by hand
+# from the Actions tab if GitHub CD is unavailable. It does NOT fire on tag
+# pushes, so the same tag is never published from two places at once.
+# Building/pushing the multi-arch images needs the DOCKERHUB_USERNAME /
+# DOCKERHUB_TOKEN repo secrets. To hand CD back to Forgejo, restore the
+# `push: tags: ['v*']` trigger here and comment out the GitHub `release` trigger.
#
on:
- push:
- tags:
- - 'v*'
workflow_dispatch:
inputs:
image_tag:
- description: "Image tag to publish (manual runs only; tag pushes use the git tag)"
+ description: "Image tag to publish"
required: false
default: latest
diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml
index e93b8c62..3a6cd02c 100644
--- a/.github/workflows/docker-publish.yml
+++ b/.github/workflows/docker-publish.yml
@@ -1,13 +1,16 @@
name: Docker Build and Publish
-# Publishing is owned by Forgejo (.forgejo/workflows/docker-publish.yml fires on
-# a v* tag). This GitHub workflow is kept as a MANUAL fallback only — it no
-# longer auto-publishes on a GitHub release, so there's no double-publish while
-# Forgejo owns CD. To revert to GitHub auto-publishing (e.g. if the Forgejo CD
-# doesn't work out), restore the `release: { types: [published] }` trigger below.
+# Publishing is owned by this GitHub workflow. It builds and pushes the
+# multi-arch images to Docker Hub when a GitHub Release is published, on public
+# runners with auditable build logs and provenance attestation. Building images
+# on public CI rather than a private runner lets anyone verify exactly how a
+# published image was produced and from which commit. The Forgejo
+# docker-publish workflow is kept as a manual fallback only (workflow_dispatch),
+# so the same tag is never published twice. To hand CD back to Forgejo, restore
+# its `push: tags` trigger and comment out the `release` trigger below.
on:
- # release:
- # types: [published]
+ release:
+ types: [published]
workflow_dispatch:
env: