Adopt shared ci-actions for publishing #1

Merged
andras merged 1 commit from ci/shared-actions into main 2026-06-06 15:18:40 +01:00

View file

@ -7,10 +7,6 @@ on:
pull_request: pull_request:
branches: [ "main" ] branches: [ "main" ]
env:
REGISTRY: ${{ forgejo.server_url }}
IMAGE_NAME: ${{ forgejo.repository }}
jobs: jobs:
build: build:
runs-on: docker runs-on: docker
@ -18,21 +14,9 @@ jobs:
- name: Checkout repository - name: Checkout repository
uses: https://code.forgejo.org/actions/checkout@v4 uses: https://code.forgejo.org/actions/checkout@v4
- name: Log into registry - name: Build and publish image
if: forgejo.event_name != 'pull_request' uses: http://forgejo:3000/andras/ci-actions/docker-publish@main
run: echo "${{ secrets.FORGEJO_TOKEN }}" | docker login ${{ env.REGISTRY }} -u ${{ forgejo.actor }} --password-stdin with:
context: .
- name: Build Docker image push: ${{ github.event_name != 'pull_request' }}
run: | token: ${{ secrets.FORGEJO_TOKEN }}
TAG="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest"
if [ "${{ forgejo.ref_type }}" = "tag" ]; then
VERSION="${{ forgejo.ref_name }}"
docker build -t "$TAG" -t "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${VERSION}" .
else
docker build -t "$TAG" .
fi
- name: Push Docker image
if: forgejo.event_name != 'pull_request'
run: |
docker push --all-tags "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}"