Skip to content

GHCR releases

GHCR releases #664

Workflow file for this run

name: Docker Build
on:
push:
branches:
- master
pull_request:
jobs:
# Parallelized: run quick docker build tests per-Dockerfile in parallel
linux-dockerfile-test:
runs-on: ubuntu-latest
container:
image: hairyhenderson/dockerfiles-builder:latest
env:
BASHBREW_LIBRARY: ./library
BASHBREW_NAMESPACE: caddy
DOCKER_BUILDKIT: '1'
strategy:
matrix:
path:
- 2.10/alpine
- 2.10/builder
- 2.11/alpine
- 2.11/builder
steps:
- uses: actions/checkout@master
- name: non-master build test (per-path)
run: |
docker build -f ${{ matrix.path }}/Dockerfile ${{ matrix.path }}
if: github.repository != 'caddyserver/caddy-docker' || github.ref != 'refs/heads/master'
# Main linux bashbrew build.
docker-linux-build:
runs-on: ubuntu-latest
container:
image: hairyhenderson/dockerfiles-builder:latest
env:
BASHBREW_LIBRARY: ./library
BASHBREW_NAMESPACE: caddy
DOCKER_BUILDKIT: '1'
needs: linux-dockerfile-test
steps:
- uses: actions/checkout@master
- name: build
run: bashbrew build caddy
- name: push
if: github.repository == 'caddyserver/caddy-docker' && github.ref == 'refs/heads/master'
# NOTE: DOCKERHUB_TOKEN and DOCKERHUB_USERNAME must be present in https://github.com/caddyserver/caddy-docker/settings
# the user must have permission to push to https://hub.docker.com/r/caddy/caddy
run: |
echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login --username ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
bashbrew push caddy
- name: push (non-master dry run)
if: github.repository != 'caddyserver/caddy-docker' || github.ref != 'refs/heads/master'
run: |
bashbrew push --dry-run caddy
# Parallelized: run quick windows docker build tests per-Dockerfile in parallel
windows-dockerfile-test:
runs-on: ${{ matrix.runner }}
strategy:
matrix:
include:
- path: 2.10/windows/ltsc2022
runner: windows-2022
- path: 2.10/windows-nanoserver/ltsc2022
runner: windows-2022
- path: 2.10/windows/ltsc2025
runner: windows-2025
- path: 2.10/windows-nanoserver/ltsc2025
runner: windows-2025
- path: 2.11/windows/ltsc2022
runner: windows-2022
- path: 2.11/windows-nanoserver/ltsc2022
runner: windows-2022
- path: 2.11/windows/ltsc2025
runner: windows-2025
- path: 2.11/windows-nanoserver/ltsc2025
runner: windows-2025
steps:
- uses: actions/checkout@master
- name: non-master build test (per-path)
if: github.repository != 'caddyserver/caddy-docker' || github.ref != 'refs/heads/master'
run: |
docker build -f ${{ matrix.path }}/Dockerfile ${{ matrix.path }}
# Main windows build (matrix over constraints) - runs after tests
windows-build:
needs: windows-dockerfile-test
runs-on: ${{ matrix.runner }}
strategy:
matrix:
include:
- constraint: windowsservercore-ltsc2022
runner: windows-2022
- constraint: windowsnanoserver-ltsc2022
runner: windows-2022
- constraint: windowsservercore-ltsc2025
runner: windows-2025
- constraint: windowsnanoserver-ltsc2025
runner: windows-2025
steps:
- uses: actions/checkout@master
- name: install bashbrew
run: curl -o /bashbrew.exe https://doi-janky.infosiftr.net/job/bashbrew/job/master/lastSuccessfulBuild/artifact/bashbrew-windows-amd64.exe
- name: build
run: |
/bashbrew --arch windows-amd64 --constraint ${{ matrix.constraint }} --namespace caddy --library ./library build caddy
- name: push
if: github.repository == 'caddyserver/caddy-docker' && github.ref == 'refs/heads/master'
# NOTE: DOCKERHUB_TOKEN and DOCKERHUB_USERNAME must be present in https://github.com/caddyserver/caddy-docker/settings
# the user must have permission to push to https://hub.docker.com/r/caddy/caddy
run: |
echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login --username ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin;
/bashbrew --arch windows-amd64 --constraint ${{ matrix.constraint }} --namespace caddy --library ./library push caddy
- name: push (non-master dry run)
if: github.repository != 'caddyserver/caddy-docker' || github.ref != 'refs/heads/master'
run: |
/bashbrew --arch windows-amd64 --constraint ${{ matrix.constraint }} --namespace caddy --library ./library push --dry-run caddy