Skip to content

all: removed snapshot versions #2

all: removed snapshot versions

all: removed snapshot versions #2

Workflow file for this run

name: ci-invoicing
on:
push:
paths:
- 'pta-invoicing/**'
tags:
- 'pta-invoicing/v*.*.*'
branches:
- 'main'
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: pta-invoicing
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- name: Checkout latest code
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
cache: maven
cache-dependency-path: 'pta-invoicing/pom.xml'
- name: Build with Maven
run: mvn -B package --file pta-invoicing/pom.xml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to the Container registry
if: startsWith(github.ref, 'refs/tags/pta-invoicing/')
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
if: startsWith(github.ref, 'refs/tags/pta-invoicing/')
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: ${{ github.ref }}
- name: Build and push Docker image
if: startsWith(github.ref, 'refs/tags/pta-invoicing/')
uses: docker/build-push-action@v4
with:
context: .
file: ./pta-invoicing/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Generate artifact attestation
if: startsWith(github.ref, 'refs/tags/pta-invoicing/')
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true