From 697db2f3e6b69b1771bd19e122d8365d98df35f7 Mon Sep 17 00:00:00 2001 From: ryuupendragon Date: Wed, 11 Feb 2026 15:54:07 +0530 Subject: [PATCH] Update WF and Dockerfile for testing --- .gitea/workflows/test.yml | 51 ++++++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 38 ---------------------------- Dockerfile | 6 ++--- 3 files changed, 54 insertions(+), 41 deletions(-) create mode 100644 .gitea/workflows/test.yml delete mode 100644 .github/workflows/test.yml diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml new file mode 100644 index 0000000..9b820fa --- /dev/null +++ b/.gitea/workflows/test.yml @@ -0,0 +1,51 @@ +name: Build and Push Docker Image + +on: + workflow_dispatch: + +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 QEMU + uses: docker/setup-qemu-action@v3.7.0 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3.12.0 + with: + driver-opts: image=moby/buildkit:v0.23.2@sha256:ddd1ca44b21eda906e81ab14a3d467fa6c39cd73b9a39df1196210edcb8db59e + - + name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5.10.0 + with: + images: | + ryuupendragon/caddy + tags: | + type=raw,value=${{ env.VERSION }},priority=1000 + type=sha,format=long,prefix=sha- + type=raw,value=latest + - + name: Build and push + uses: docker/build-push-action@v6.18.0 + with: + context: . + push: false + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + platforms: linux/arm64 + cache-from: type=gha + cache-to: type=gha,mode=max + build-args: | + BUILDKIT_INLINE_CACHE=1 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 4737fc1..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,38 +0,0 @@ -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 }} diff --git a/Dockerfile b/Dockerfile index 2f761a7..061bbb9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ -FROM caddy:2.10.0-builder AS builder +FROM caddy:2.10.2-builder@sha256:23e70f63a88bacd9b0564d055eed5c25b98e90930876cca01aee1f5d1ae29748 AS builder RUN xcaddy build \ --with github.com/caddy-dns/cloudflare -FROM caddy:2.10.0 +FROM caddy:2.10.2@sha256:f20f80e1fb627294fb84b8515b7593aff8018c840f1396dc942a50ed0c2db648 -COPY --from=builder /usr/bin/caddy /usr/bin/caddy \ No newline at end of file +COPY --from=builder /usr/bin/caddy /usr/bin/caddy