Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use docker metadata to generate combos of labels, tags, and images #3396

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions .github/workflows/develop-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ jobs:
- name: Compile dotnet app
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
dotnet-version: 8.0.x

- name: Install Swashbuckle CLI
run: dotnet tool install -g Swashbuckle.AspNetCore.Cli
Expand All @@ -137,6 +137,7 @@ jobs:

- name: Login to Docker Hub
uses: docker/login-action@v3
if: ${{ github.repository_owner == 'Kareadita' }}
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
Expand All @@ -155,20 +156,33 @@ jobs:
id: buildx
uses: docker/setup-buildx-action@v3

- name: Extract metadata (tags, labels) for Docker
id: docker_meta_nightly
uses: docker/metadata-action@v5
with:
tags: |
type=raw,value=nightly
type=raw,value=nightly-${{ steps.parse-version.outputs.VERSION }}
images: |
name=jvmilazz0/kavita,enable=${{ github.repository_owner == 'Kareadita' }}
name=ghcr.io/${{ github.repository }}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: true
tags: jvmilazz0/kavita:nightly, jvmilazz0/kavita:nightly-${{ steps.parse-version.outputs.VERSION }}, ghcr.io/kareadita/kavita:nightly, ghcr.io/kareadita/kavita:nightly-${{ steps.parse-version.outputs.VERSION }}
tags: ${{ steps.docker_meta_nightly.outputs.tags }}
labels: ${{ steps.docker_meta_nightly.outputs.labels }}

- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

- name: Notify Discord
uses: rjstone/discord-webhook-notify@v1
if: ${{ github.repository_owner == 'Kareadita' }}
with:
severity: info
description: v${{steps.get-version.outputs.assembly-version}} - ${{ steps.findPr.outputs.title }}
Expand Down
33 changes: 29 additions & 4 deletions .github/workflows/release-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ jobs:

- name: Login to Docker Hub
uses: docker/login-action@v3
if: ${{ github.repository_owner == 'Kareadita' }}
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
Expand All @@ -132,23 +133,47 @@ jobs:
id: buildx
uses: docker/setup-buildx-action@v3

- name: Extract metadata (tags, labels) for Docker
id: docker_meta_stable
uses: docker/metadata-action@v5
with:
tags: |
type=raw,value=latest
type=raw,value=${{ steps.parse-version.outputs.VERSION }}
images: |
name=jvmilazz0/kavita,enable=${{ github.repository_owner == 'Kareadita' }}
name=ghcr.io/${{ github.repository }}

- name: Build and push stable
id: docker_build_stable
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: true
tags: jvmilazz0/kavita:latest, jvmilazz0/kavita:${{ steps.parse-version.outputs.VERSION }}, ghcr.io/kareadita/kavita:latest, ghcr.io/kareadita/kavita:${{ steps.parse-version.outputs.VERSION }}
tags: ${{ steps.docker_meta_stable.outputs.tags }}
labels: ${{ steps.docker_meta_stable.outputs.labels }}

- name: Extract metadata (tags, labels) for Docker
id: docker_meta_nightly
uses: docker/metadata-action@v5
with:
tags: |
type=raw,value=nightly
type=raw,value=nightly-${{ steps.parse-version.outputs.VERSION }}
images: |
name=jvmilazz0/kavita,enable=${{ github.repository_owner == 'Kareadita' }}
name=ghcr.io/${{ github.repository }}

- name: Build and push nightly
id: docker_build_nightly
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: true
tags: jvmilazz0/kavita:nightly, jvmilazz0/kavita:nightly-${{ steps.parse-version.outputs.VERSION }}, ghcr.io/kareadita/kavita:nightly, ghcr.io/kareadita/kavita:nightly-${{ steps.parse-version.outputs.VERSION }}
tags: ${{ steps.docker_meta_nightly.outputs.tags }}
labels: ${{ steps.docker_meta_nightly.outputs.labels }}

- name: Image digest
run: echo ${{ steps.docker_build_stable.outputs.digest }}
Expand Down