44 lines
1.1 KiB
YAML
44 lines
1.1 KiB
YAML
name: Docker
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Log in to Codeberg registry
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: codeberg.org
|
|
username: ${{ secrets.REGISTRY_USER }}
|
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
|
|
- name: Extract version tag
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
id: meta
|
|
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
|
|
|
- name: Build (verify only, no push)
|
|
if: github.ref == 'refs/heads/master'
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
push: false
|
|
|
|
- name: Build and push (tagged release)
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: |
|
|
codeberg.org/${{ github.repository }}:${{ steps.meta.outputs.tag }}
|
|
codeberg.org/${{ github.repository }}:latest
|