Update WF

This commit is contained in:
2026-02-12 19:37:39 +05:30
parent 09217762c9
commit 02450fcb8a

View File

@@ -6,12 +6,7 @@ on:
branches: [ main ]
paths:
- 'caddy-*/**'
- '.github/workflows/**'
pull_request:
branches: [ main ]
paths:
- 'caddy-*/**'
- '.github/workflows/**'
- '.gitea/workflows/**'
jobs:
build:
@@ -43,7 +38,18 @@ jobs:
-
name: Parse Caddy version
id: version
run: echo "version=$(grep -oP '(?<=FROM caddy:)[0-9]+\.[0-9]+\.[0-9]+' ${{ matrix.variant.dockerfile }} | head -n 1)" >> $GITHUB_OUTPUT
run: |
VERSION=$(grep -m 1 -Eo 'caddy:[0-9]+\.[0-9]+\.[0-9]' caddy-cloudflare/Dockerfile | cut -d ':' -f2)
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Version from file: $VERSION"
# Extract semantic version parts
MAJOR=$(echo $VERSION | cut -d. -f1)
MINOR=$(echo $VERSION | cut -d. -f1-2)
echo "major_version=$MAJOR" >> $GITHUB_OUTPUT
echo "minor_version=$MINOR" >> $GITHUB_OUTPUT
echo "Major: $MAJOR, Minor: $MINOR"
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3.7.0
@@ -74,16 +80,18 @@ jobs:
ghcr.io/${{ vars.GH_USERNAME }}/caddy-${{ matrix.variant.name }}
${{ vars.DOCKERHUB_USERNAME }}/caddy-${{ matrix.variant.name }}
tags: |
type=raw,value=${{ steps.version.outputs.version }}
type=sha,format=long,prefix=sha-
type=raw,value=latest
type=raw,value=${{ steps.version.outputs.major_version }}
type=raw,value=${{ steps.version.outputs.minor_version }}
type=raw,value=${{ steps.version.outputs.version }},priority=1000
-
name: Build and push
uses: docker/build-push-action@v6.18.0
with:
context: ${{ matrix.variant.context }}
file: ${{ matrix.variant.dockerfile }}
push: ${{ github.event_name != 'pull_request' }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64,linux/arm/v7