2023-06-26 08:49:37 +02:00
name : Docker build and push
on :
workflow_call :
push :
tags :
- v*.*.*
jobs :
release :
name : Build & release to DockerHub
runs-on : ubuntu-latest
steps :
- name : Checkout
uses : actions/checkout@v3
- name : Docker meta
id : meta
uses : docker/metadata-action@v4
with :
# List of Docker images to use as base name for tags
images : |
mediacms/mediacms
# Generate Docker tags based on the following events/attributes
# Set latest tag for default branch
tags : |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
labels : |
org.opencontainers.image.title=MediaCMS
org.opencontainers.image.description=MediaCMS is a modern, fully featured open source video and media CMS, written in Python/Django and React, featuring a REST API.
org.opencontainers.image.vendor=MediaCMS
org.opencontainers.image.url=https://mediacms.io/
org.opencontainers.image.source=https://github.com/mediacms-io/mediacms
org.opencontainers.image.licenses=AGPL-3.0
2023-06-28 14:32:32 +02:00
2023-06-26 08:49:37 +02:00
- name : Login to Docker Hub
2023-06-27 16:50:16 +02:00
uses : docker/login-action@v2.2.0
2023-06-26 08:49:37 +02:00
with :
2023-06-28 14:32:32 +02:00
username : ${{ secrets.DOCKERHUB_USERNAME }}
2023-06-27 17:22:37 +02:00
password : ${{ secrets.DOCKERHUB_TOKEN }}
2023-06-26 08:49:37 +02:00
- name : Build and push
uses : docker/build-push-action@v4
with :
context : .
push : ${{ github.event_name != 'pull_request' }}
tags : ${{ steps.meta.outputs.tags }}
labels : ${{ steps.meta.outputs.labels }}