ci: add Dockerfile and Gitea Actions workflow for automated image builds
Some checks failed
Build and Push Docker Image / build (push) Has been cancelled

- Dockerfile based on node:18-alpine
- Gitea Actions workflow triggers on push to release/* branches
- Builds and pushes to Gitea container registry with version tags
This commit is contained in:
2026-05-15 15:15:09 +01:00
parent d90908c1da
commit 87f8c2d42b
3 changed files with 72 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
name: Build and Push Docker Image
on:
push:
branches:
- 'release/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Extract version from package.json
id: version
run: |
VERSION=$(node -p "require('./package.json').version")
BRANCH=${GITHUB_REF#refs/heads/}
RELEASE_NAME=${BRANCH#release/}
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "release=${RELEASE_NAME}" >> $GITHUB_OUTPUT
echo "Building version ${VERSION} from branch ${BRANCH}"
- name: Login to Gitea Container Registry
uses: docker/login-action@v3
with:
registry: git.i3omb.com
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
git.i3omb.com/gandalf/sofarr:${{ steps.version.outputs.version }}
git.i3omb.com/gandalf/sofarr:${{ steps.version.outputs.release }}
git.i3omb.com/gandalf/sofarr:latest