58 lines
2 KiB
YAML
58 lines
2 KiB
YAML
name: Publish Docker
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
tags:
|
|
- "v[0-9]+.[0-9]+.[0-9]+"
|
|
|
|
jobs:
|
|
build_and_push:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
max-parallel: 1
|
|
matrix:
|
|
build_type: ['release', 'debug']
|
|
concurrency:
|
|
group: ci-${{ github.ref }}-${{ matrix.build_type }}
|
|
cancel-in-progress: true
|
|
steps:
|
|
- name: Set tag
|
|
run: |
|
|
if [[ -n "${{ inputs.tag }}" ]]; then
|
|
TAG=${{ inputs.tag }}
|
|
elif [[ "${{ github.ref_name }}" == 'main' ]]; then
|
|
TAG="latest"
|
|
else
|
|
TAG=${{ github.ref_name }}
|
|
fi
|
|
echo "TAG=${TAG}" >> $GITHUB_ENV
|
|
echo "BUILD_PKG=llama_forge_rs" >> $GITHUB_ENV
|
|
echo "BUILD_TYPE=${{ matrix.build_type }}" >> $GITHUB_ENV
|
|
echo "IMAGE=${{matrix.build_pkg}}:${TAG}-${{matrix.build_type}}" >> $GITHUB_ENV
|
|
echo "TAG=${TAG}"
|
|
echo "BUILD_PKG=llama_forge_rs"
|
|
echo "BUILD_TYPE=${{ matrix.build_type }}"
|
|
echo "IMAGE=${{matrix.build_pkg}}:${TAG}-${{matrix.build_type}}"
|
|
- name: Checkout
|
|
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4
|
|
- name: Install docker
|
|
uses: https://github.com/papodaca/install-docker-action@main
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3
|
|
- name: Login to DockerHub
|
|
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3
|
|
with:
|
|
registry: git.vlt81.de
|
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
- name: Build and push
|
|
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5
|
|
with:
|
|
context: .
|
|
platforms: linux/amd64
|
|
push: true
|
|
tags: git.vlt81.de/oekonzept/${{env.IMAGE}}
|
|
build-args: |
|
|
BUILD_TYPE=${{env.BUILD_TYPE}}
|
|
BUILD_PKG=${{env.BUILD_PKG}}
|