Skip to content

Update docker/metadata-action action to v5.6.1 #279

Update docker/metadata-action action to v5.6.1

Update docker/metadata-action action to v5.6.1 #279

Workflow file for this run

---
name: Create and publish Docker image
on:
pull_request:
branches:
- 'main'
- 'renovate/**'
push:
branches:
- main
env:
REGISTRY: ghcr.io
IMAGE_NAME: T-Systems-MMS/dmc
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
example:
- min
- full
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Log in to the Container registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
if: github.ref == 'refs/heads/main'
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5.6.1
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
if: github.ref == 'refs/heads/main'
- name: Render Dockerfile ${{ matrix.example }}
run: cp examples/${{ matrix.example }}_build.yaml ./build.yaml && sh render.sh .
- name: Build the container dmc:${{ matrix.example }}
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5.4.0
with:
context: .
push: false
tags: dmc:${{ matrix.example }}
- name: Test the container $IMAGE_NAME:${{ matrix.example }}
run: |
docker run --rm dmc:${{ matrix.example }}
if: matrix.example == 'min'
- name: Test the container $IMAGE_NAME:${{ matrix.example }}
run: |
docker run --rm dmc:${{ matrix.example }} ansible --version
docker run --rm dmc:${{ matrix.example }} kubectl version --client=true -o yaml
docker run --rm dmc:${{ matrix.example }} helm version
docker run --rm dmc:${{ matrix.example }} terraform version
docker run --rm dmc:${{ matrix.example }} nomad version
docker run --rm dmc:${{ matrix.example }} consul version
docker run --rm dmc:${{ matrix.example }} docker --version
docker run --rm dmc:${{ matrix.example }} az version
docker run --rm dmc:${{ matrix.example }} aws --version
if: matrix.example == 'full'
- name: Build and push dmc:${{ matrix.example }}
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5.4.0
with:
context: .
push: true
tags: ghcr.io/telekom-mms/dmc/${{ matrix.example }}
labels: ${{ steps.meta.outputs.labels }}
if: github.ref == 'refs/heads/main'