Update WF with parse

This commit is contained in:
2025-07-04 23:18:38 +05:30
parent a8142f1b35
commit 58661409f8

View File

@@ -4,8 +4,8 @@ on:
workflow_dispatch:
push:
branches: [ "main" ]
paths-ignore:
- '**/README.md'
paths:
- Dockerfile
jobs:
build:
@@ -19,6 +19,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Parse Caddy version
id: version
run: echo "VERSION=$(grep -Eo 'caddy:[0-9]+\.[0-9]+\.[0-9]+$' Dockerfile | cut -d ':' -f2)" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
@@ -31,7 +35,7 @@ jobs:
- name: Build and Push Docker images for all Container Registries
uses: docker/build-push-action@v6
with:
tags: ${{ vars.DOCKERHUB_REPO }}:${{ vars.VERSION }}-${{matrix.config.arch}}, ${{ vars.DOCKERHUB_REPO }}:latest-${{matrix.config.arch}}
tags: ${{ vars.DOCKERHUB_REPO }}:$VERSION-${{matrix.config.arch}}, ${{ vars.DOCKERHUB_REPO }}:latest-${{matrix.config.arch}}
file: Dockerfile
push: true
@@ -39,6 +43,13 @@ jobs:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Parse Caddy version
id: version
run: echo "VERSION=$(grep -Eo 'caddy:[0-9]+\.[0-9]+\.[0-9]+$' Dockerfile | cut -d ':' -f2)" >> $GITHUB_ENV
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
@@ -48,8 +59,8 @@ jobs:
- name: Create and push manifest images for pinned
uses: Noelware/docker-manifest-action@v1
with:
inputs: ${{ vars.DOCKERHUB_REPO }}:${{ vars.VERSION }}-arm64,${{ vars.DOCKERHUB_REPO }}:${{ vars.VERSION }}-amd64
tags: ${{ vars.DOCKERHUB_REPO }}:${{ vars.VERSION }}
inputs: ${{ vars.DOCKERHUB_REPO }}:$VERSION-arm64,${{ vars.DOCKERHUB_REPO }}:$VERSION-amd64
tags: ${{ vars.DOCKERHUB_REPO }}:$VERSION
push: true
- name: Create and push manifest images for latest