infra/.forgejo/workflows/docker-publish.yml

38 lines
981 B
YAML

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