Add reusable docker-publish workflow

This commit is contained in:
Graham McIntire 2026-07-24 14:19:33 -05:00
parent c20001ce9f
commit 653346a7a3
No known key found for this signature in database
GPG key ID: F4ABF488E6029E59

View file

@ -0,0 +1,38 @@
on:
workflow_call:
inputs:
image_name:
required: true
type: string
description: "Image name (e.g. aprs.me)"
registry:
required: false
type: string
default: "git.mcintire.me"
description: "Container registry hostname"
username:
required: false
type: string
default: "graham"
secrets:
FORGEJO_TOKEN:
required: true
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login to Forgejo Registry
uses: graham/infra/.forgejo/actions/container-login@main
with:
registry: ${{ inputs.registry }}
username: ${{ inputs.username }}
token: ${{ secrets.FORGEJO_TOKEN }}
- name: Build and Push
run: |
TAG=${{ inputs.registry }}/${{ inputs.username }}/${{ inputs.image_name }}:latest
docker build -t $TAG .
docker push $TAG