changed version name for release #3
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 | |
on: | |
push: | |
tags: | |
- v** | |
branches: | |
- master | |
pull_request: | |
env: | |
REGISTRY: ghcr.io | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
registry: ${{ env.REGISTRY }} | |
- name: Install xml2 dependency | |
run: | | |
if ! command -v xml2; then | |
sudo apt update | |
sudo apt install -y xml2 | |
fi | |
- name: Get version | |
id: version | |
run: echo "version=$(xml2 < pom.xml | awk -F '=' '/\/project\/version=/ {print $2}')" >> ${GITHUB_OUTPUT} | |
- name: Generate Docker meta names | |
uses: docker/metadata-action@v5 | |
id: meta | |
with: | |
images: ${{ env.REGISTRY }}/${{ github.repository }} | |
tags: | | |
type=ref,event=tag | |
type=raw,enable=${{ !startsWith(github.ref, 'refs/tags/') }},value=master | |
flavor: | | |
latest=true | |
labels: | | |
org.opencontainers.image.version=${{ steps.version.outputs.version }} | |
- name: Build Docker | |
uses: docker/build-push-action@v6 | |
env: | |
DOCKER_BUILD_SUMMARY: ${{ inputs.build-summary }} | |
with: | |
push: ${{ github.event_name != 'pull_request' }} | |
context: . | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
provenance: false |