Remove unneeded builds
This commit is contained in:
@@ -3,10 +3,10 @@ name: Build and Push Docker Images
|
|||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches: [ main ]
|
branches: [main]
|
||||||
paths:
|
paths:
|
||||||
- 'caddy-*/**'
|
- "caddy-*/**"
|
||||||
- '.gitea/workflows/build-and-push.yml'
|
- ".gitea/workflows/build-and-push.yml"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -14,65 +14,49 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
variant:
|
variant:
|
||||||
- name: 'cloudflare'
|
- name: "cloudflare"
|
||||||
dockerfile: 'caddy-cloudflare/Dockerfile'
|
dockerfile: "caddy-cloudflare/Dockerfile"
|
||||||
context: 'caddy-cloudflare'
|
context: "caddy-cloudflare"
|
||||||
- name: 'cloudflare-crowdsec'
|
- name: "cloudflare-crowdsec"
|
||||||
dockerfile: 'caddy-cloudflare-crowdsec/Dockerfile'
|
dockerfile: "caddy-cloudflare-crowdsec/Dockerfile"
|
||||||
context: 'caddy-cloudflare-crowdsec'
|
context: "caddy-cloudflare-crowdsec"
|
||||||
- name: 'cloudflare-ddns'
|
|
||||||
dockerfile: 'caddy-cloudflare-ddns/Dockerfile'
|
|
||||||
context: 'caddy-cloudflare-ddns'
|
|
||||||
- name: 'cloudflare-ddns-crowdsec'
|
|
||||||
dockerfile: 'caddy-cloudflare-ddns-crowdsec/Dockerfile'
|
|
||||||
context: 'caddy-cloudflare-ddns-crowdsec'
|
|
||||||
- name: 'crowdsec'
|
|
||||||
dockerfile: 'caddy-crowdsec/Dockerfile'
|
|
||||||
context: 'caddy-crowdsec'
|
|
||||||
fail-fast: true
|
fail-fast: true
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
-
|
- name: Checkout code
|
||||||
name: Checkout code
|
|
||||||
uses: actions/checkout@v6.0.3
|
uses: actions/checkout@v6.0.3
|
||||||
-
|
- name: Parse Caddy version
|
||||||
name: Parse Caddy version
|
|
||||||
id: version
|
id: version
|
||||||
run: |
|
run: |
|
||||||
VERSION=$(grep -m 1 -Eo 'caddy:[0-9]+\.[0-9]+\.[0-9]' caddy-cloudflare/Dockerfile | cut -d ':' -f2)
|
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=$VERSION" >> $GITHUB_OUTPUT
|
||||||
echo "Version from file: $VERSION"
|
echo "Version from file: $VERSION"
|
||||||
|
|
||||||
# Extract semantic version parts
|
# Extract semantic version parts
|
||||||
MAJOR=$(echo $VERSION | cut -d. -f1)
|
MAJOR=$(echo $VERSION | cut -d. -f1)
|
||||||
MINOR=$(echo $VERSION | cut -d. -f1-2)
|
MINOR=$(echo $VERSION | cut -d. -f1-2)
|
||||||
|
|
||||||
echo "major_version=$MAJOR" >> $GITHUB_OUTPUT
|
echo "major_version=$MAJOR" >> $GITHUB_OUTPUT
|
||||||
echo "minor_version=$MINOR" >> $GITHUB_OUTPUT
|
echo "minor_version=$MINOR" >> $GITHUB_OUTPUT
|
||||||
echo "Major: $MAJOR, Minor: $MINOR"
|
echo "Major: $MAJOR, Minor: $MINOR"
|
||||||
-
|
- name: Set up QEMU
|
||||||
name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v4.1.0
|
uses: docker/setup-qemu-action@v4.1.0
|
||||||
-
|
- name: Set up Docker Buildx
|
||||||
name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v4.1.0
|
uses: docker/setup-buildx-action@v4.1.0
|
||||||
with:
|
with:
|
||||||
driver-opts: image=moby/buildkit:v0.23.2@sha256:ddd1ca44b21eda906e81ab14a3d467fa6c39cd73b9a39df1196210edcb8db59e
|
driver-opts: image=moby/buildkit:v0.23.2@sha256:ddd1ca44b21eda906e81ab14a3d467fa6c39cd73b9a39df1196210edcb8db59e
|
||||||
-
|
- name: Login to GitHub Container Registry
|
||||||
name: Login to GitHub Container Registry
|
|
||||||
uses: docker/login-action@v4.2.0
|
uses: docker/login-action@v4.2.0
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ vars.GH_USERNAME }}
|
username: ${{ vars.GH_USERNAME }}
|
||||||
password: ${{ secrets.GH_TOKEN }}
|
password: ${{ secrets.GH_TOKEN }}
|
||||||
-
|
- name: Login to Docker Hub
|
||||||
name: Login to Docker Hub
|
|
||||||
uses: docker/login-action@v4.2.0
|
uses: docker/login-action@v4.2.0
|
||||||
with:
|
with:
|
||||||
username: ${{ vars.DOCKERHUB_USERNAME }}
|
username: ${{ vars.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
-
|
- name: Extract metadata (tags, labels) for Docker
|
||||||
name: Extract metadata (tags, labels) for Docker
|
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v6.1.0
|
uses: docker/metadata-action@v6.1.0
|
||||||
with:
|
with:
|
||||||
@@ -85,8 +69,7 @@ jobs:
|
|||||||
type=raw,value=${{ steps.version.outputs.major_version }}
|
type=raw,value=${{ steps.version.outputs.major_version }}
|
||||||
type=raw,value=${{ steps.version.outputs.minor_version }}
|
type=raw,value=${{ steps.version.outputs.minor_version }}
|
||||||
type=raw,value=${{ steps.version.outputs.version }},priority=1000
|
type=raw,value=${{ steps.version.outputs.version }},priority=1000
|
||||||
-
|
- name: Build and push
|
||||||
name: Build and push
|
|
||||||
uses: docker/build-push-action@v7.2.0
|
uses: docker/build-push-action@v7.2.0
|
||||||
with:
|
with:
|
||||||
context: ${{ matrix.variant.context }}
|
context: ${{ matrix.variant.context }}
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ name: Build Test
|
|||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ main ]
|
branches: [main]
|
||||||
paths:
|
paths:
|
||||||
- 'caddy-*/**'
|
- "caddy-*/**"
|
||||||
- '.gitea/workflows/**'
|
- ".gitea/workflows/**"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -14,43 +14,35 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
variant:
|
variant:
|
||||||
- name: 'cloudflare'
|
- name: "cloudflare"
|
||||||
dockerfile: 'caddy-cloudflare/Dockerfile'
|
dockerfile: "caddy-cloudflare/Dockerfile"
|
||||||
context: 'caddy-cloudflare'
|
context: "caddy-cloudflare"
|
||||||
- name: 'crowdsec'
|
|
||||||
dockerfile: 'caddy-crowdsec/Dockerfile'
|
|
||||||
context: 'caddy-crowdsec'
|
|
||||||
fail-fast: true
|
fail-fast: true
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
-
|
- name: Checkout code
|
||||||
name: Checkout code
|
|
||||||
uses: actions/checkout@v6.0.3
|
uses: actions/checkout@v6.0.3
|
||||||
-
|
- name: Parse Caddy version
|
||||||
name: Parse Caddy version
|
|
||||||
id: version
|
id: version
|
||||||
run: |
|
run: |
|
||||||
VERSION=$(grep -m 1 -Eo 'caddy:[0-9]+\.[0-9]+\.[0-9]' caddy-cloudflare/Dockerfile | cut -d ':' -f2)
|
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=$VERSION" >> $GITHUB_OUTPUT
|
||||||
echo "Version from file: $VERSION"
|
echo "Version from file: $VERSION"
|
||||||
|
|
||||||
# Extract semantic version parts
|
# Extract semantic version parts
|
||||||
MAJOR=$(echo $VERSION | cut -d. -f1)
|
MAJOR=$(echo $VERSION | cut -d. -f1)
|
||||||
MINOR=$(echo $VERSION | cut -d. -f1-2)
|
MINOR=$(echo $VERSION | cut -d. -f1-2)
|
||||||
|
|
||||||
echo "major_version=$MAJOR" >> $GITHUB_OUTPUT
|
echo "major_version=$MAJOR" >> $GITHUB_OUTPUT
|
||||||
echo "minor_version=$MINOR" >> $GITHUB_OUTPUT
|
echo "minor_version=$MINOR" >> $GITHUB_OUTPUT
|
||||||
echo "Major: $MAJOR, Minor: $MINOR"
|
echo "Major: $MAJOR, Minor: $MINOR"
|
||||||
-
|
- name: Set up QEMU
|
||||||
name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v4.1.0
|
uses: docker/setup-qemu-action@v4.1.0
|
||||||
-
|
- name: Set up Docker Buildx
|
||||||
name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v4.1.0
|
uses: docker/setup-buildx-action@v4.1.0
|
||||||
with:
|
with:
|
||||||
driver-opts: image=moby/buildkit:v0.23.2@sha256:ddd1ca44b21eda906e81ab14a3d467fa6c39cd73b9a39df1196210edcb8db59e
|
driver-opts: image=moby/buildkit:v0.23.2@sha256:ddd1ca44b21eda906e81ab14a3d467fa6c39cd73b9a39df1196210edcb8db59e
|
||||||
-
|
- name: Extract metadata (tags, labels) for Docker
|
||||||
name: Extract metadata (tags, labels) for Docker
|
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v6.1.0
|
uses: docker/metadata-action@v6.1.0
|
||||||
with:
|
with:
|
||||||
@@ -63,8 +55,7 @@ jobs:
|
|||||||
type=raw,value=${{ steps.version.outputs.major_version }}
|
type=raw,value=${{ steps.version.outputs.major_version }}
|
||||||
type=raw,value=${{ steps.version.outputs.minor_version }}
|
type=raw,value=${{ steps.version.outputs.minor_version }}
|
||||||
type=raw,value=${{ steps.version.outputs.version }},priority=1000
|
type=raw,value=${{ steps.version.outputs.version }},priority=1000
|
||||||
-
|
- name: Build Test
|
||||||
name: Build Test
|
|
||||||
uses: docker/build-push-action@v7.2.0
|
uses: docker/build-push-action@v7.2.0
|
||||||
with:
|
with:
|
||||||
context: ${{ matrix.variant.context }}
|
context: ${{ matrix.variant.context }}
|
||||||
|
|||||||
Reference in New Issue
Block a user