Adopt shared ci-actions for publishing
Some checks failed
CI / Check (pull_request) Failing after 1m42s
CI / Check (push) Failing after 1m49s
Build and publish Docker image / build-and-push (push) Successful in 5m56s

Replace the inline publish step(s) with the canonical shell-only composite
actions in andras/ci-actions (deploy-pages / docker-publish / forgejo-release).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Andras Schmelczer 2026-06-06 14:58:37 +01:00
parent 3e307c2fff
commit 719dd27600

View file

@ -13,85 +13,15 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Install Docker CLI - name: Build and publish main image
run: | uses: http://forgejo:3000/andras/ci-actions/docker-publish@main
ARCH=$(uname -m)
curl -fsSL "https://download.docker.com/linux/static/stable/${ARCH}/docker-27.5.1.tgz" \
| tar xz --strip-components=1 -C /usr/local/bin docker/docker
docker --version
- name: Set up Docker Buildx
uses: https://github.com/docker/setup-buildx-action@v3
with:
driver-opts: |
network=host
- name: Resolve registry vars
id: registry
env:
CONTAINER_REGISTRY_HOST: ${{ vars.CONTAINER_REGISTRY_HOST }}
run: |
host="${CONTAINER_REGISTRY_HOST:-${{ gitea.server_url }}}"
host="${host#https://}"
host="${host#http://}"
host="${host%/}"
if [ "$host" = "forgejo:3000" ]; then
host="127.0.0.1:13000"
fi
repo=$(echo "${{ gitea.repository }}" | tr '[:upper:]' '[:lower:]')
owner="${repo%%/*}"
{
echo "host=${host}"
echo "owner=${owner}"
echo "image=${host}/${repo}"
echo "screenshot_image=${host}/${repo}-screenshot"
} >> "$GITHUB_OUTPUT"
- name: Log in to Forgejo Container Registry
uses: https://github.com/docker/login-action@v3
with:
registry: ${{ steps.registry.outputs.host }}
username: ${{ steps.registry.outputs.owner }}
password: ${{ secrets.FORGEJO_PACKAGE_TOKEN }}
- name: Extract metadata (main)
id: meta
uses: https://github.com/docker/metadata-action@v5
with:
images: ${{ steps.registry.outputs.image }}
tags: |
type=sha,format=short
type=raw,value=latest,enable={{is_default_branch}}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Build and push (main)
uses: https://github.com/docker/build-push-action@v6
with: with:
context: . context: .
push: true token: ${{ secrets.FORGEJO_PACKAGE_TOKEN }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=${{ steps.registry.outputs.image }}:buildcache
cache-to: type=registry,ref=${{ steps.registry.outputs.image }}:buildcache,mode=max
- name: Extract metadata (screenshot) - name: Build and publish screenshot image
id: meta-screenshot uses: http://forgejo:3000/andras/ci-actions/docker-publish@main
uses: https://github.com/docker/metadata-action@v5
with:
images: ${{ steps.registry.outputs.screenshot_image }}
tags: |
type=sha,format=short
type=raw,value=latest,enable={{is_default_branch}}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Build and push (screenshot)
uses: https://github.com/docker/build-push-action@v6
with: with:
context: ./screenshot context: ./screenshot
push: true image-suffix: -screenshot
tags: ${{ steps.meta-screenshot.outputs.tags }} token: ${{ secrets.FORGEJO_PACKAGE_TOKEN }}
labels: ${{ steps.meta-screenshot.outputs.labels }}
cache-from: type=registry,ref=${{ steps.registry.outputs.screenshot_image }}:buildcache
cache-to: type=registry,ref=${{ steps.registry.outputs.screenshot_image }}:buildcache,mode=max