Files
sofarr/.gitea/workflows/build-image.yml
T
gronod ff5f50cc3a
Build and Push Docker Image / build (push) Successful in 58s
CI / Security audit (push) Successful in 1m43s
CI / Swagger Validation & Coverage (push) Successful in 2m6s
CI / Tests & coverage (push) Successful in 2m26s
chore: remove reg.i3omb.com from build-image workflow
Only publish container images to git.i3omb.com registry.
2026-05-27 21:46:34 +01:00

61 lines
1.8 KiB
YAML

name: Build and Push Docker Image
on:
push:
branches:
- 'release/**'
- 'develop*'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Compute image tags
id: meta
run: |
VERSION=$(node -p "require('./package.json').version")
BRANCH=${GITHUB_REF#refs/heads/}
echo "version=${VERSION}" >> $GITHUB_OUTPUT
if [[ "$BRANCH" == develop* ]]; then
# Sanitise branch name for tag: replace slashes with dashes
SAFE_BRANCH=$(echo "$BRANCH" | tr '/' '-')
TAGS="git.i3omb.com/gandalf/sofarr:${SAFE_BRANCH}"
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
echo "Building develop image tags: ${TAGS}"
else
RELEASE_NAME=${BRANCH#release/}
# Gitea package registry tags
TAGS="git.i3omb.com/gandalf/sofarr:${VERSION}"
TAGS="${TAGS},git.i3omb.com/gandalf/sofarr:${RELEASE_NAME}"
TAGS="${TAGS},git.i3omb.com/gandalf/sofarr:latest"
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
echo "Building release image tags: ${TAGS}"
fi
- name: Log into Gitea Container Registry
uses: docker/login-action@v3
with:
registry: git.i3omb.com
username: ${{ github.actor }}
password: ${{ secrets.RELEASE_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: |
org.opencontainers.image.version=${{ steps.meta.outputs.version }}
org.opencontainers.image.created=${{ github.event.head_commit.timestamp }}