Docker Build and Publish #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Build and Publish | |
# | |
# Docker image tagging strategy: | |
# | |
# Release tags (v1.0.0): {version}, latest | |
# Release candidates (v1.0.0-rc1): {version}, next | |
# Branches (feature/x): {branch-name} | |
# | |
# This ensures stable releases are tagged as 'latest' while release candidates | |
# are tagged as 'next' for early testing. Branch builds get descriptive tags. | |
# | |
on: | |
push: | |
tags: [ "v*" ] | |
pull_request: | |
types: [closed] | |
branches: [ "develop", "feature/*", "rel/*" ] | |
workflow_dispatch: | |
permissions: | |
contents: read | |
packages: write | |
jobs: | |
build-and-publish-main: | |
uses: ./.github/workflows/.docker-build-publish-reusable.yml | |
with: | |
image-suffix: '' | |
dockerfile: 'Dockerfile' | |
image_tags: | | |
type=ref,event=branch | |
type=ref,event=tag | |
type=raw,value=next,enable=${{ contains(github.ref, '-rc') }} | |
secrets: inherit | |
build-and-publish-lite: | |
needs: [build-and-publish-main] | |
uses: ./.github/workflows/.docker-build-publish-reusable.yml | |
with: | |
image-suffix: '-lite' | |
dockerfile: 'Dockerfile-lite' | |
image_tags: | | |
type=ref,event=branch | |
type=ref,event=tag | |
type=raw,value=next,enable=${{ contains(github.ref, '-rc') }} | |
secrets: inherit |