Update WF
This commit is contained in:
@@ -6,12 +6,7 @@ on:
|
|||||||
branches: [ main ]
|
branches: [ main ]
|
||||||
paths:
|
paths:
|
||||||
- 'caddy-*/**'
|
- 'caddy-*/**'
|
||||||
- '.github/workflows/**'
|
- '.gitea/workflows/**'
|
||||||
pull_request:
|
|
||||||
branches: [ main ]
|
|
||||||
paths:
|
|
||||||
- 'caddy-*/**'
|
|
||||||
- '.github/workflows/**'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -43,7 +38,18 @@ jobs:
|
|||||||
-
|
-
|
||||||
name: Parse Caddy version
|
name: Parse Caddy version
|
||||||
id: 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
|
name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3.7.0
|
uses: docker/setup-qemu-action@v3.7.0
|
||||||
@@ -74,16 +80,18 @@ jobs:
|
|||||||
ghcr.io/${{ vars.GH_USERNAME }}/caddy-${{ matrix.variant.name }}
|
ghcr.io/${{ vars.GH_USERNAME }}/caddy-${{ matrix.variant.name }}
|
||||||
${{ vars.DOCKERHUB_USERNAME }}/caddy-${{ matrix.variant.name }}
|
${{ vars.DOCKERHUB_USERNAME }}/caddy-${{ matrix.variant.name }}
|
||||||
tags: |
|
tags: |
|
||||||
type=raw,value=${{ steps.version.outputs.version }}
|
|
||||||
type=sha,format=long,prefix=sha-
|
type=sha,format=long,prefix=sha-
|
||||||
type=raw,value=latest
|
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
|
name: Build and push
|
||||||
uses: docker/build-push-action@v6.18.0
|
uses: docker/build-push-action@v6.18.0
|
||||||
with:
|
with:
|
||||||
context: ${{ matrix.variant.context }}
|
context: ${{ matrix.variant.context }}
|
||||||
file: ${{ matrix.variant.dockerfile }}
|
file: ${{ matrix.variant.dockerfile }}
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: true
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||||
Reference in New Issue
Block a user