ci(gitea): add workflow for publishing Docker images
Adds Gitea CI/CD workflow that builds and pushes Docker images to the registry on tag push or manual trigger. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
name: Publish image
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: Image tag to publish (only used for manual runs)
|
||||
required: false
|
||||
default: manual
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ready2blob-image
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Resolve image tag
|
||||
id: vars
|
||||
run: |
|
||||
if [ "${{ github.ref_type }}" = "tag" ]; then
|
||||
echo "tag=${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "tag=${{ inputs.tag }}" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- name: Log in to git.azuze.fr registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: git.azuze.fr
|
||||
username: ${{ gitea.actor }}
|
||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: |
|
||||
git.azuze.fr/kawa/ready2blob:${{ steps.vars.outputs.tag }}
|
||||
git.azuze.fr/kawa/ready2blob:latest
|
||||
Reference in New Issue
Block a user