[CI] Add an action to build docker images

Not used here directly but will be in other repositories
This commit is contained in:
Earlopain 2023-08-04 20:28:04 +02:00
parent 7002be5a79
commit 725aca3bf8
No known key found for this signature in database
GPG Key ID: 48860312319ADF61

View File

@ -0,0 +1,36 @@
# Not used here but in other repos
name: Docker Build and Push
description: Docker Build and Push
runs:
using: composite
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Github Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
- name: Generate Docker tags
uses: docker/metadata-action@v4
id: metadata
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=sha,format=long,prefix=
flavor: |
latest=true
- name: Build and push
uses: docker/build-push-action@v4
with:
push: true
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max