Skip to content

Commit

Permalink
feat: add caddy
Browse files Browse the repository at this point in the history
  • Loading branch information
daflyinbed committed Jun 7, 2024
1 parent 67c88cb commit 2c6e5da
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,24 @@ jobs:
tags: ${{ steps.ng_meta.outputs.tags }}
labels: ${{ steps.ng_meta.outputs.labels }}
build-args: VERSION=${{ github.ref_name }}

- name: Extract nginx Docker Metadata
id: caddy_meta
uses: docker/metadata-action@v5
with:
images: |
registry.cn-shanghai.aliyuncs.com/prts/ng
ghcr.io/mooncellwiki/ng
tags: |
type=semver,pattern={{raw}}
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: .github/workflows/caddy.Dockerfile
push: true
tags: ${{ steps.ng_meta.outputs.tags }}
labels: ${{ steps.ng_meta.outputs.labels }}
build-args: VERSION=${{ github.ref_name }}
12 changes: 12 additions & 0 deletions .github/workflows/caddy.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM caddy:2.8.4-builder AS builder

RUN xcaddy build \
--with github.com/caddyserver/cache-handler@v0.13.0

FROM caddy:2.8.4

COPY --from=builder /usr/bin/caddy /usr/bin/caddy

FROM ghcr.io/mooncellwiki/mw:$VERSION as mw

COPY --from=mw /var/www/html/ /srv/

0 comments on commit 2c6e5da

Please sign in to comment.