Compare commits
27 Commits
renovate/c
...
dispatch
| Author | SHA1 | Date | |
|---|---|---|---|
| 69ee3e8b14 | |||
| f8643ac173 | |||
| 9d6404c2f4 | |||
| e5a635c741 | |||
| e04f237647 | |||
| de2b1bbbac | |||
| a136f6982a | |||
| d4c4cd3dfb | |||
| 683fa5c055 | |||
| 046a225e7e | |||
| e5b46d6385 | |||
| 69cad58d3f | |||
| 5195bbca59 | |||
| 5eecde82b3 | |||
| 087e5b576f | |||
| e7cc9a3266 | |||
| 862ae7dd2b | |||
| 95ef39b83c | |||
| 889cffd45b | |||
| f98a84551d | |||
| 776f1b1fd1 | |||
| 356ccabf9c | |||
| 29016b9cf4 | |||
| 7053f2f43b | |||
| 778054feda | |||
| cbe3fdd719 | |||
| 3cc527e684 |
111
.github/workflows/action.yml
vendored
Normal file
111
.github/workflows/action.yml
vendored
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
name: Docker Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
registry: # id of input
|
||||||
|
description: 'docker regisry host name'
|
||||||
|
required: true
|
||||||
|
default: 'gitea.phadric.de'
|
||||||
|
cache-registry: # id of input
|
||||||
|
description: 'docker regisry host name'
|
||||||
|
required: true
|
||||||
|
default: 'imagecache.phadric.de'
|
||||||
|
image_name:
|
||||||
|
description: 'name of the dockerimage'
|
||||||
|
required: true
|
||||||
|
default: ${{ github.repository }}
|
||||||
|
token:
|
||||||
|
description: 'repo auth token'
|
||||||
|
required: true
|
||||||
|
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: slim
|
||||||
|
steps:
|
||||||
|
- run: echo "::group::Checkout repository"
|
||||||
|
if: ${{ always() }}
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
|
||||||
|
with:
|
||||||
|
fetch-depth: '0'
|
||||||
|
- run: echo "::endgroup::"
|
||||||
|
if: ${{ always() }}
|
||||||
|
- run: echo "::group::Bump version and push tag"
|
||||||
|
if: ${{ always() }}
|
||||||
|
- name: Bump version and push tag
|
||||||
|
id: tag
|
||||||
|
uses: phadric/github-tag-action@a5250a59655e9f4b0350407380a92c73948f2aec # master
|
||||||
|
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 }}
|
||||||
|
- run: echo "::endgroup::"
|
||||||
|
if: ${{ always() }}
|
||||||
|
- run: echo "::group::Extract Docker metadata"
|
||||||
|
if: ${{ always() }}
|
||||||
|
- name: Extract Docker metadata
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.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 }}
|
||||||
|
- run: echo "::endgroup::"
|
||||||
|
if: ${{ always() }}
|
||||||
|
- run: echo "::group::Configure build Cache"
|
||||||
|
if: ${{ always() }}
|
||||||
|
- uses: int128/docker-build-cache-config-action@338206c80bf9eeb2b9694b7b4fc8c247c317e2a8 # v1.38.0
|
||||||
|
id: cache
|
||||||
|
with:
|
||||||
|
image: ${{ inputs.cache-registry }}/${{ inputs.image_name }}-cache
|
||||||
|
extra-cache-to: image-manifest=true
|
||||||
|
- run: echo "::endgroup::"
|
||||||
|
if: ${{ always() }}
|
||||||
|
- run: echo "::group::Setup Buildx"
|
||||||
|
if: ${{ always() }}
|
||||||
|
- name: Setup Docker buildx
|
||||||
|
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
|
||||||
|
- run: echo "::endgroup::"
|
||||||
|
if: ${{ always() }}
|
||||||
|
- run: echo "::group::Log into Registry ${{ inputs.registry }}"
|
||||||
|
if: ${{ always() }}
|
||||||
|
- name: Log into registry ${{ inputs.registry }}
|
||||||
|
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
|
||||||
|
with:
|
||||||
|
registry: ${{ inputs.registry }}
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ inputs.token }}
|
||||||
|
- run: echo "::endgroup::"
|
||||||
|
if: ${{ always() }}
|
||||||
|
- run: echo "::group::Build and Push docker image"
|
||||||
|
if: ${{ always() }}
|
||||||
|
- name: Build and push Docker image
|
||||||
|
id: build-and-push
|
||||||
|
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.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
|
||||||
|
- run: echo "::endgroup::"
|
||||||
|
if: ${{ always() }}
|
||||||
2
.github/workflows/lint.yml
vendored
2
.github/workflows/lint.yml
vendored
@@ -17,7 +17,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
|
||||||
- name: Verify Action
|
- 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
|
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
|
- name: tag latest after success
|
||||||
|
|||||||
81
action.yml
81
action.yml
@@ -1,81 +0,0 @@
|
|||||||
name: 'Tag Build and Push Docker image'
|
|
||||||
description: 'Tags verion in current repo, builds docker image and pushes it to registry'
|
|
||||||
inputs:
|
|
||||||
registry: # id of input
|
|
||||||
description: 'docker regisry host name'
|
|
||||||
required: true
|
|
||||||
default: 'gitea.phadric.de'
|
|
||||||
image_name:
|
|
||||||
description: 'name of the dockerimage'
|
|
||||||
required: true
|
|
||||||
default: ${{ github.repository }}
|
|
||||||
token:
|
|
||||||
description: 'repo auth token'
|
|
||||||
required: true
|
|
||||||
|
|
||||||
runs:
|
|
||||||
using: "composite"
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
|
|
||||||
with:
|
|
||||||
fetch-depth: '0'
|
|
||||||
|
|
||||||
- name: Bump version and push tag
|
|
||||||
id: tag
|
|
||||||
uses: phadric/github-tag-action@a5250a59655e9f4b0350407380a92c73948f2aec # master
|
|
||||||
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@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
|
|
||||||
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@34bb1b5886d06c161bf0dd9e169f03a52ff858fb # v1.35.0
|
|
||||||
id: cache
|
|
||||||
with:
|
|
||||||
image: ${{ inputs.registry }}/${{ inputs.image_name }}-cache
|
|
||||||
extra-cache-to: image-manifest=true
|
|
||||||
|
|
||||||
- name: Setup Docker buildx
|
|
||||||
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1
|
|
||||||
|
|
||||||
- name: Log into registry ${{ inputs.registry }}
|
|
||||||
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.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@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
push: true
|
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
|
||||||
platforms: linux/amd64
|
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
|
||||||
cache-from: |
|
|
||||||
type=registry,ref=${{ inputs.registry }}/${{ inputs.image_name }}-cache:latest
|
|
||||||
type=registry,ref=${{ inputs.registry }}/${{ inputs.image_name }}-cache:${{ github.ref_name }}
|
|
||||||
${{ steps.cache.outputs.cache-from }}
|
|
||||||
cache-to: |
|
|
||||||
${{ steps.cache.outputs.cache-to }}
|
|
||||||
type=registry,ref=${{ inputs.registry }}/${{ inputs.image_name }}-cache:latest,mode=max,image-manifest=true
|
|
||||||
Reference in New Issue
Block a user