Skip to content

meta: Update Github Actions #22

meta: Update Github Actions

meta: Update Github Actions #22

Workflow file for this run

name: build
on:
workflow_dispatch:
push:
branches:
- 'master'
tags:
- 'v*'
pull_request:
branches:
- 'master'
env:
IMAGE_NAME: "ghcr.io/i-al-istannen/doctor"
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '22'
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: "${{ env.IMAGE_NAME }}"
sep-tags: ","
sep-labels: ","
tags: |
type=ref,event=branch
type=ref,event=pr
type=ref,event=tag
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=edge,branch=master
type=sha
type=sha,format=long
- name: Login to registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: "${{ github.repository_owner }}"
password: "${{ secrets.GITHUB_TOKEN }}"
- name: Remove prefix from tags (stolen)
run: echo "fixed_tags=${{ steps.meta.outputs.tags }}" | sed 's;${{ env.IMAGE_NAME }}:;;g' >> $GITHUB_ENV
- name: Build and publish docker image
run: |
mvn package jib:build \
-Djib.to.tags="${{ env.fixed_tags }}" \
-Djib.container.labels="${{ steps.meta.outputs.labels }}" \
-Djib.console=plain \
-Djib.to.image="${{ env.IMAGE_NAME }}"