Test
This commit is contained in:
@@ -3,9 +3,17 @@ name: Docker Build and Publish
|
|||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
DOCKERHUB_REPO: ghcr.io/ryuupendragon/caddy-crowdsec
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker-build-and-publish:
|
build:
|
||||||
runs-on: bookworm
|
strategy:
|
||||||
|
matrix:
|
||||||
|
config:
|
||||||
|
- {arch: 'arm64'}
|
||||||
|
- {arch: 'amd64'}
|
||||||
|
runs-on: ${{ matrix.config.arch == 'arm64' && 'ubuntu-arm64' || 'ubuntu-amd64' }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -13,6 +21,51 @@ jobs:
|
|||||||
- name: Parse Caddy version
|
- name: Parse Caddy version
|
||||||
id: version
|
id: version
|
||||||
run: echo "VERSION=$(grep -Eo 'caddy:[0-9]+\.[0-9]+\.[0-9]+$' Dockerfile | cut -d ':' -f2)" >> $GITHUB_ENV
|
run: echo "VERSION=$(grep -Eo 'caddy:[0-9]+\.[0-9]+\.[0-9]+$' Dockerfile | cut -d ':' -f2)" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Print version
|
- name: Set up Docker Buildx
|
||||||
run: echo $VERSION
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ vars.GH_USERNAME }}
|
||||||
|
password: ${{ secrets.GH_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and Push Docker images for all Container Registries
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
tags: ${{ env.DOCKERHUB_REPO }}:${{ env.VERSION }}-${{matrix.config.arch}}, ${{ env.DOCKERHUB_REPO }}:latest-${{matrix.config.arch}}
|
||||||
|
file: Dockerfile
|
||||||
|
push: true
|
||||||
|
|
||||||
|
merge-docker-manifest:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: build
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
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: Login to Docker Hub
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
username: ${{ vars.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Create and push manifest images for pinned
|
||||||
|
uses: Noelware/docker-manifest-action@v1
|
||||||
|
with:
|
||||||
|
inputs: ${{ env.DOCKERHUB_REPO }}:${{ env.VERSION }}-arm64,${{ env.DOCKERHUB_REPO }}:${{ env.VERSION }}-amd64
|
||||||
|
tags: ${{ env.DOCKERHUB_REPO }}:${{ env.VERSION }}
|
||||||
|
push: true
|
||||||
|
|
||||||
|
- name: Create and push manifest images for latest
|
||||||
|
uses: Noelware/docker-manifest-action@v1
|
||||||
|
with:
|
||||||
|
inputs: ${{ env.DOCKERHUB_REPO }}:latest-arm64,${{ env.DOCKERHUB_REPO }}:latest-amd64
|
||||||
|
tags: ${{ env.DOCKERHUB_REPO }}:latest
|
||||||
|
push: true
|
||||||
|
@@ -1,9 +1,7 @@
|
|||||||
FROM caddy:2.10.0-builder AS builder
|
FROM caddy:2.10.0-builder AS builder
|
||||||
|
|
||||||
RUN xcaddy build \
|
RUN xcaddy build \
|
||||||
--with github.com/hslatman/caddy-crowdsec-bouncer/http \
|
--with github.com/hslatman/caddy-crowdsec-bouncer/http
|
||||||
--with github.com/hslatman/caddy-crowdsec-bouncer/layer4 \
|
|
||||||
--with github.com/hslatman/caddy-crowdsec-bouncer/appsec
|
|
||||||
|
|
||||||
FROM caddy:2.10.0
|
FROM caddy:2.10.0
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user