Example: a Dockerfile and the workflow that publishes it

This commit is contained in:
2026-10-05 19:18:59 +02:00
commit acbb7e92aa
4 changed files with 90 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
# Builds the Dockerfile at the root for every v* tag and pushes it to this forge's staging registry.
# IPCR picks it up from there within a minute and publishes it on IPFS; the forge's page then
# lists the exact `image:` line to use.
#
# Differences from a GitHub-hosted workflow, all needed on this forge:
# login to localhost:5000 the staging registry, as this repository: IPCR_PUSH_TOKEN is a secret
# the forge sets on every repository allowed to publish
# images: localhost:5000/… this repository's own name there (no other is accepted)
# network=host so buildx's builder can reach that registry
# runs-on: ipcr the forge's own runner, the one that sees that registry (a Gitea app's
# own runner, if there is one, does not)
name: image
on:
push:
tags: ['v*']
jobs:
image:
runs-on: ipcr
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
registry: localhost:5000
username: ${{ github.repository }}
password: ${{ secrets.IPCR_PUSH_TOKEN }}
- uses: docker/metadata-action@v5
id: meta
with:
images: localhost:5000/${{ github.repository }}
tags: |
type=semver,pattern={{version}}
type=raw,value=latest
- uses: docker/setup-buildx-action@v3
with:
driver-opts: network=host
- uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}