This commit is contained in:
2025-08-04 23:18:58 +05:30
commit 83c8f4722e
3 changed files with 47 additions and 0 deletions

38
.github/workflows/test.yml vendored Normal file
View File

@@ -0,0 +1,38 @@
name: Build and Push Docker Image
on:
workflow_dispatch:
push:
branches: [ main ]
env:
DOCKERHUB_REPO: caddy-test
jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Checkout code
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
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'workflow_dispatch' }}
tags: ${{ vars.DOCKERHUB_USERNAME }}/${{ env.DOCKERHUB_REPO }}:latest,${{ vars.DOCKERHUB_USERNAME }}/${{ env.DOCKERHUB_REPO }}:${{ env.VERSION }}

8
Dockerfile Normal file
View File

@@ -0,0 +1,8 @@
FROM caddy:2.10.0-builder AS builder
RUN xcaddy build \
--with github.com/caddy-dns/cloudflare
FROM caddy:2.10.0
COPY --from=builder /usr/bin/caddy /usr/bin/caddy

1
README.md Normal file
View File

@@ -0,0 +1 @@
# docker-caddy-test