Skip to content

Clean meta values from special characters. #15

Clean meta values from special characters.

Clean meta values from special characters. #15

name: Containers
on:
pull_request:
push:
branches: ['main']
tags:
- v*.*.*
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
containers:
- auditor
- auditor-apel-plugin
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to Docker Hub
if: ${{ github.repository == 'ALU-Schumacher/AUDITOR' && github.ref == 'refs/heads/main' }}
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Log in to ghcr.io
if: ${{ github.repository == 'ALU-Schumacher/AUDITOR' && github.ref == 'refs/heads/main' }}
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: |
aluschumacher/${{ matrix.containers }}
ghcr.io/ALU-Schumacher/${{ matrix.containers }}
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
file: containers/${{ matrix.containers }}/Dockerfile
push: ${{ github.repository == 'ALU-Schumacher/AUDITOR' && github.ref == 'refs/heads/main' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max