Author SHA1 Message Date
renovate acf95830ef Update actions/checkout action to v6 #none major
Actionlint / build (push) Successful in 28s
2025-12-02 17:06:08 +00:00
3 changed files with 8 additions and 103 deletions
-93
View File
@@ -1,93 +0,0 @@
name: 'Tag Build and Push Docker image'
on:
workflow_call:
inputs:
registry: # id of input
description: 'docker regisry host name'
type: string
default: 'gitea.phadric.de'
cache-registry: # id of input
description: 'docker regisry host name'
default: 'imagecache.phadric.de'
type: string
image_name:
description: 'name of the dockerimage'
required: true
type: string
checkout:
description: 'checkout repo first'
default: 'true'
type: string
tag:
description: 'checkout repo first'
default: 'true'
type: string
# secrets:
# TOKEN:
# description: 'repo auth token'
# required: true
jobs:
build:
runs-on: slim
steps:
- name: Checkout repository
if: ${{ inputs.checkout == 'true' }}
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: '0'
- name: Bump version and push tag
id: tag
if: ${{ inputs.tag == 'true' }}
uses: anothrNick/github-tag-action@4ed44965e0db8dab2b466a16da04aec3cc312fd8 # 1.75.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # if you don't want to set write permissions use a PAT token
DEFAULT_BUMP: patch
GIT_API_TAGGING: false # dont use API
WITH_V: true
PRERELEASE: true
PRERELEASE_SUFFIX: ${{ github.ref_name }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0
with:
flavor: |
latest=${{ github.ref_name == 'main' || github.ref_name == 'master' }}
tags: |
type=ref,event=branch
type=semver,pattern={{version}},value=${{steps.tag.outputs.tag}}
# output 0.1
type=semver,pattern={{major}}.{{minor}},value=${{steps.tag.outputs.tag}}
# disabled if major zero
type=semver,pattern={{major}},value=${{steps.tag.outputs.tag}},enable=${{ !startsWith(steps.tag.outputs.tag, 'v0.') }}
images: ${{ inputs.registry }}/${{ inputs.image_name }}
- uses: int128/docker-build-cache-config-action@d1b27ffbf29fb93b7239130db030c702198fd52b # v1.64.0
id: cache
with:
image: ${{ inputs.cache-registry }}/${{ inputs.image_name }}-cache
extra-cache-to: image-manifest=true
- name: Setup Docker buildx
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
- name: Log into registry ${{ inputs.registry }}
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
with:
registry: ${{ inputs.registry }}
username: ${{ github.actor }}
password: ${{ secrets.TOKEN }}
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
platforms: linux/amd64
labels: ${{ steps.meta.outputs.labels }}
cache-from: |
type=registry,ref=${{ inputs.cache-registry }}/${{ inputs.image_name }}-cache:latest
type=registry,ref=${{ inputs.cache-registry }}/${{ inputs.image_name }}-cache:${{ github.ref_name }}
${{ steps.cache.outputs.cache-from }}
cache-to: |
${{ steps.cache.outputs.cache-to }}
type=registry,ref=${{ inputs.cache-registry }}/${{ inputs.image_name }}-cache:latest,mode=max,image-manifest=true
+2 -4
View File
@@ -13,15 +13,13 @@ jobs:
build:
runs-on: slim
permissions:
contents: write
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Verify Action
run: actionlint -ignore 'unexpected key "description" for "workflow" section' -ignore 'nexpected key "inputs" for "workflow" section.' -ignore 'unexpected key "runs" for "workflow" section.' -ignore '"on" section is missing in workflow' -ignore '"jobs" section is missing in workflow' action.yml
- name: Verify Workflow
run: actionlint -ignore 'label "slim" is unknown' .github/workflows/docker-build.yml
- name: tag latest after success
if: github.ref == 'refs/heads/main'
id: tag
+6 -6
View File
@@ -29,7 +29,7 @@ runs:
steps:
- name: Checkout repository
if: ${{ inputs.checkout == 'true' }}
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: '0'
- name: Bump version and push tag
@@ -45,7 +45,7 @@ runs:
PRERELEASE_SUFFIX: ${{ github.ref_name }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0
with:
flavor: |
latest=${{ github.ref_name == 'main' || github.ref_name == 'master' }}
@@ -57,22 +57,22 @@ runs:
# disabled if major zero
type=semver,pattern={{major}},value=${{steps.tag.outputs.tag}},enable=${{ !startsWith(steps.tag.outputs.tag, 'v0.') }}
images: ${{ inputs.registry }}/${{ inputs.image_name }}
- uses: int128/docker-build-cache-config-action@d1b27ffbf29fb93b7239130db030c702198fd52b # v1.64.0
- uses: int128/docker-build-cache-config-action@fb186e80c08f14a2e56ed9105d4594562bff013f # v1.40.0
id: cache
with:
image: ${{ inputs.cache-registry }}/${{ inputs.image_name }}-cache
extra-cache-to: image-manifest=true
- name: Setup Docker buildx
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Log into registry ${{ inputs.registry }}
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
with:
registry: ${{ inputs.registry }}
username: ${{ github.actor }}
password: ${{ inputs.token }}
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: .
push: true