Author SHA1 Message Date
renovate 51ab68c00b Update Github Actions #none major
Actionlint / build (push) Successful in 20s
2026-04-10 10:06:50 +00:00
3 changed files with 8 additions and 104 deletions
-96
View File
@@ -1,96 +0,0 @@
name: 'Tag Build and Push Docker image'
description: 'Tags version in current repo, builds docker image and pushes it to registry'
on:
workflow_call:
inputs:
registry: # id of input
description: 'docker regisry host name'
required: true
type: string
default: 'gitea.phadric.de'
cache-registry: # id of input
description: 'docker regisry host name'
required: true
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@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.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@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.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@6b41b75cecc2e81696c50ae7c6c0300b51c2bee1 # v1.62.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@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
- name: Log into registry ${{ inputs.registry }}
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.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@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2
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 -2
View File
@@ -13,11 +13,11 @@ jobs:
build:
runs-on: slim
permissions:
contents: write
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- 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: tag latest after success
+6 -6
View File
@@ -29,7 +29,7 @@ runs:
steps:
- name: Checkout repository
if: ${{ inputs.checkout == 'true' }}
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
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@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.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@6b41b75cecc2e81696c50ae7c6c0300b51c2bee1 # v1.62.0
- uses: int128/docker-build-cache-config-action@4788c7e22b9923ca0e44bc7a29281b5beb545e5d # v1.49.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@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
- name: Log into registry ${{ inputs.registry }}
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.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@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
with:
context: .
push: true