Add more docker tags (docker/metadata-action)

This commit is contained in:
Søren L. Hansen 2023-07-28 08:33:53 -07:00 committed by Soren L. Hansen
parent 8dd044c7cf
commit ddca6a4663

View File

@ -1,10 +1,10 @@
--- ---
name: "pre-release" name: "pre-release"
on: on: [push]
push:
branches: env:
- "master" IMAGE_NAME: ${{ github.repository }}
jobs: jobs:
pre-release-docker: pre-release-docker:
@ -13,15 +13,31 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
with: with:
fetch-depth: 0 fetch-depth: 0
-
name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=sha,format=long
type=sha
type=semver,pattern=v{{major}}.{{minor}}.{{patch}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}
type=ref,event=tag
type=ref,event=branch
- uses: docker/setup-qemu-action@v1 - uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1 - uses: docker/setup-buildx-action@v1
- uses: docker/login-action@v1 - uses: docker/login-action@v2
with: with:
username: "${{ secrets.DOCKER_HUB_USER }}" username: "${{ secrets.DOCKER_HUB_USER }}"
password: "${{ secrets.DOCKER_HUB_TOKEN }}" password: "${{ secrets.DOCKER_HUB_TOKEN }}"
@ -33,4 +49,5 @@ jobs:
file: ./Dockerfile file: ./Dockerfile
platforms: linux/amd64,linux/arm/v7,linux/arm64 platforms: linux/amd64,linux/arm/v7,linux/arm64
push: true push: true
tags: "${{ secrets.DOCKER_REPO }}:latest" tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}