52 lines
1.4 KiB
YAML
52 lines
1.4 KiB
YAML
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
|