mirror of
https://github.com/ciromattia/kcc
synced 2025-12-12 17:26:23 +00:00
68 lines
1.8 KiB
YAML
68 lines
1.8 KiB
YAML
name: Build and Publish Docker Image
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
tags:
|
|
- 'v*.*.*'
|
|
|
|
# Don't trigger if it's just a documentation update
|
|
paths-ignore:
|
|
- '**.md'
|
|
- '**.MD'
|
|
- '**.yml'
|
|
- 'docs/**'
|
|
- 'LICENSE'
|
|
- '.gitattributes'
|
|
- '.gitignore'
|
|
|
|
jobs:
|
|
build_and_publish_base_image:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
|
|
- name: Login to GitHub Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Set Release Date
|
|
id: release_date
|
|
run: |
|
|
echo "release_date=$(date --rfc-3339=date)" >> $GITHUB_OUTPUT
|
|
|
|
- name: Docker meta
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: ghcr.io/${{ github.repository_owner }}/kcc
|
|
# Always creates the "latest" tag
|
|
flavor: |
|
|
latest=true
|
|
tags: |
|
|
type=ref,event=tag
|
|
type=raw,value=${{ steps.release_date.outputs.release_date }}
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
|
context: .
|
|
push: true
|
|
tags: |
|
|
${{ steps.meta.outputs.tags }}
|
|
cache-from: |
|
|
type=registry,ref=ghcr.io/ciromattia/kcc:cache
|
|
type=registry,ref=ghcr.io/${{ github.repository_owner }}/kcc:cache
|
|
cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/kcc:cache,mode=max
|