Add reusable docker-publish workflow
This commit is contained in:
parent
c20001ce9f
commit
653346a7a3
1 changed files with 38 additions and 0 deletions
38
.forgejo/workflows/docker-publish.yml
Normal file
38
.forgejo/workflows/docker-publish.yml
Normal 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
|
||||
Loading…
Add table
Reference in a new issue