This commit is contained in:
35
action.yml
35
action.yml
@@ -16,20 +16,19 @@ inputs:
|
|||||||
token:
|
token:
|
||||||
description: 'repo auth token'
|
description: 'repo auth token'
|
||||||
required: true
|
required: true
|
||||||
|
checkout:
|
||||||
|
description: 'checkout repo first'
|
||||||
|
default: 'true'
|
||||||
|
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- run: echo "::group::Checkout repository"
|
|
||||||
if: ${{ always() }}
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
|
if: ${{ github.event.inputs.foo == 'true' }}
|
||||||
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
|
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
|
||||||
with:
|
with:
|
||||||
fetch-depth: '0'
|
fetch-depth: '0'
|
||||||
- run: echo "::endgroup::"
|
|
||||||
if: ${{ always() }}
|
|
||||||
- run: echo "::group::Bump version and push tag"
|
|
||||||
if: ${{ always() }}
|
|
||||||
- name: Bump version and push tag
|
- name: Bump version and push tag
|
||||||
id: tag
|
id: tag
|
||||||
uses: phadric/github-tag-action@a5250a59655e9f4b0350407380a92c73948f2aec # master
|
uses: phadric/github-tag-action@a5250a59655e9f4b0350407380a92c73948f2aec # master
|
||||||
@@ -40,10 +39,6 @@ runs:
|
|||||||
WITH_V: true
|
WITH_V: true
|
||||||
PRERELEASE: true
|
PRERELEASE: true
|
||||||
PRERELEASE_SUFFIX: ${{ github.ref_name }}
|
PRERELEASE_SUFFIX: ${{ github.ref_name }}
|
||||||
- run: echo "::endgroup::"
|
|
||||||
if: ${{ always() }}
|
|
||||||
- run: echo "::group::Extract Docker metadata"
|
|
||||||
if: ${{ always() }}
|
|
||||||
- name: Extract Docker metadata
|
- name: Extract Docker metadata
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0
|
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0
|
||||||
@@ -58,35 +53,19 @@ runs:
|
|||||||
# disabled if major zero
|
# disabled if major zero
|
||||||
type=semver,pattern={{major}},value=${{steps.tag.outputs.tag}},enable=${{ !startsWith(steps.tag.outputs.tag, 'v0.') }}
|
type=semver,pattern={{major}},value=${{steps.tag.outputs.tag}},enable=${{ !startsWith(steps.tag.outputs.tag, 'v0.') }}
|
||||||
images: ${{ inputs.registry }}/${{ inputs.image_name }}
|
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@b3744816a5ba1ad9885b634d530b35ca90ece622 # v1.39.0
|
- uses: int128/docker-build-cache-config-action@b3744816a5ba1ad9885b634d530b35ca90ece622 # v1.39.0
|
||||||
id: cache
|
id: cache
|
||||||
with:
|
with:
|
||||||
image: ${{ inputs.cache-registry }}/${{ inputs.image_name }}-cache
|
image: ${{ inputs.cache-registry }}/${{ inputs.image_name }}-cache
|
||||||
extra-cache-to: image-manifest=true
|
extra-cache-to: image-manifest=true
|
||||||
- run: echo "::endgroup::"
|
|
||||||
if: ${{ always() }}
|
|
||||||
- run: echo "::group::Setup Buildx"
|
|
||||||
if: ${{ always() }}
|
|
||||||
- name: Setup Docker buildx
|
- name: Setup Docker buildx
|
||||||
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
|
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 }}
|
- name: Log into registry ${{ inputs.registry }}
|
||||||
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
|
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
|
||||||
with:
|
with:
|
||||||
registry: ${{ inputs.registry }}
|
registry: ${{ inputs.registry }}
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ inputs.token }}
|
password: ${{ inputs.token }}
|
||||||
- run: echo "::endgroup::"
|
|
||||||
if: ${{ always() }}
|
|
||||||
- run: echo "::group::Build and Push docker image"
|
|
||||||
if: ${{ always() }}
|
|
||||||
- name: Build and push Docker image
|
- name: Build and push Docker image
|
||||||
id: build-and-push
|
id: build-and-push
|
||||||
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
|
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
|
||||||
@@ -102,6 +81,4 @@ runs:
|
|||||||
${{ steps.cache.outputs.cache-from }}
|
${{ steps.cache.outputs.cache-from }}
|
||||||
cache-to: |
|
cache-to: |
|
||||||
${{ steps.cache.outputs.cache-to }}
|
${{ steps.cache.outputs.cache-to }}
|
||||||
type=registry,ref=${{ inputs.cache-registry }}/${{ inputs.image_name }}-cache:latest,mode=max,image-manifest=true
|
type=registry,ref=${{ inputs.cache-registry }}/${{ inputs.image_name }}-cache:latest,mode=max,image-manifest=true
|
||||||
- run: echo "::endgroup::"
|
|
||||||
if: ${{ always() }}
|
|
||||||
Reference in New Issue
Block a user