Skip to content

Merge pull request #144 from UnitVectorY-Labs/dependabot/github_actio… #184

Merge pull request #144 from UnitVectorY-Labs/dependabot/github_actio…

Merge pull request #144 from UnitVectorY-Labs/dependabot/github_actio… #184

name: Build and Push Development Docker Images
on:
push:
branches: [ "main" ]
paths-ignore:
- 'docs/**'
- 'mkdocs.yml'
jobs:
build-and-push:
runs-on: ubuntu-latest
timeout-minutes: 30
concurrency:
group: docker-${{ matrix.profile }}
permissions:
contents: read
packages: write
strategy:
matrix:
include:
- profile: server-manage
tag: manage
- profile: server-token
tag: token
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set lowercase repository name
run: |
echo "REPO_LC=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
- name: Build and push Docker image
uses: docker/build-push-action@v7
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ghcr.io/${{ env.REPO_LC }}-${{ matrix.tag }}-snapshot:dev
build-args: |
MAVEN_PROFILE=${{ matrix.profile }}
- name: Set lowercase package name
run: |
PACKAGE_NAME=${GITHUB_REPOSITORY##*/}
echo "PACKAGE_NAME_LC=${PACKAGE_NAME,,}" >> $GITHUB_ENV
- name: Clean up untagged (dangling) docker images
uses: actions/delete-package-versions@v5
with:
owner: ${{ github.repository_owner }}
package-name: ${{ env.PACKAGE_NAME_LC }}-${{ matrix.tag }}-snapshot
package-type: container
min-versions-to-keep: 1-
delete-only-untagged-versions: 'true'