Set the flavor and tags in the metadata base on the current build yaml for v5 namely:

- schedule = nightly
 - latest = only on tag/publish
 - else branch name (on dev)

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
Adam Warner
2024-09-02 18:36:20 +01:00
parent 26d0b85942
commit 7a33749f4e

View File

@@ -2,6 +2,11 @@ name: Build Image and Publish
on:
schedule:
- cron: "0 5 * * *"
push:
branches:
- dev
release:
types: [published]
env:
@@ -27,8 +32,15 @@ jobs:
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
- name: Checkout Repo
if: github.event_name != 'schedule'
uses: actions/checkout@v4
- name: Checkout dev branch if scheduled
if: github.event_name == 'schedule'
uses: actions/checkout@v4
with:
ref: dev
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
@@ -38,9 +50,11 @@ jobs:
${{ env.dockerhub }}
${{ env.ghcr }}
flavor: |
latest=false
latest=${{ startsWith(github.ref, 'refs/tags/') }}
tags: |
development-v6
type=schedule,pattern=nightly
type=ref,event=branch,enable=${{ github.event_name != 'schedule' }}
type=ref,event=tag
- name: Login to DockerHub and GitHub Container Registry
uses: ./.github/actions/login-repo
@@ -115,9 +129,11 @@ jobs:
${{ env.dockerhub }}
${{ env.ghcr }}
flavor: |
latest=false
latest=${{ startsWith(github.ref, 'refs/tags/') }}
tags: |
development-v6
type=schedule,pattern=nightly
type=ref,event=branch,enable=${{ github.event_name != 'schedule' }}
type=ref,event=tag
- name: Login to DockerHub and GitHub Container Registry
uses: ./.github/actions/login-repo