Files
MilkyShots/.gitea/workflows/build-and-push.yml
T
REDCODE 213c643263
Build and Push Containers / build-and-push (milkstream) (push) Failing after 1m15s
Build and Push Containers / build-and-push (lactose) (push) Failing after 1m16s
ci: pass SixLaborsLicenseKey as build arg for lactose
2026-07-17 01:48:56 +02:00

64 lines
1.8 KiB
YAML

name: Build and Push Containers
on:
push:
branches:
- master
- develop
- hotfix/*
tags:
- 'v*'
workflow_dispatch:
inputs:
version:
description: 'Version tag (e.g., v1.2.3)'
required: true
default: 'manual'
jobs:
build-and-push:
strategy:
matrix:
service: [lactose, milkstream]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- name: Log in to Gitea Container Registry
uses: docker/login-action@v3
with:
registry: ${{ gitea.server_url }}
username: ${{ gitea.actor }}
password: ${{ secrets.GITEA_TOKEN }}
- name: Determine version tag
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
else
echo "VERSION=${{ gitea.ref_name }}" >> $GITHUB_ENV
fi
- name: Prepare build args for ${{ matrix.service }}
run: |
if [ "${{ matrix.service }}" = "lactose" ]; then
echo "BUILD_ARGS=SixLaborsLicenseKey=${{ secrets.SIXLABORS_KEY }}" >> $GITHUB_ENV
else
echo "BUILD_ARGS=" >> $GITHUB_ENV
fi
- name: Build and push ${{ matrix.service }}
uses: docker/build-push-action@v5
with:
context: .
file: ./${{ matrix.service }}/Dockerfile
push: true
tags: |
${{ gitea.server_url }}/${{ gitea.repository }}/${{ matrix.service }}:${{ env.VERSION }}
${{ gitea.server_url }}/${{ gitea.repository }}/${{ matrix.service }}:latest
build-args: ${{ env.BUILD_ARGS }}
cache-from: type=gha
cache-to: type=gha,mode=max