|
6 | 6 | pull_request: |
7 | 7 |
|
8 | 8 | jobs: |
9 | | - docker-linux-build: |
| 9 | + # Parallelized: run quick docker build tests per-Dockerfile in parallel |
| 10 | + linux-dockerfile-test: |
10 | 11 | runs-on: ubuntu-latest |
11 | 12 | container: |
12 | 13 | image: hairyhenderson/dockerfiles-builder:latest |
13 | 14 | env: |
14 | 15 | BASHBREW_LIBRARY: ./library |
15 | 16 | BASHBREW_NAMESPACE: caddy |
16 | 17 | DOCKER_BUILDKIT: '1' |
| 18 | + strategy: |
| 19 | + matrix: |
| 20 | + path: |
| 21 | + - 2.10/alpine |
| 22 | + - 2.10/builder |
| 23 | + - 2.11/alpine |
| 24 | + - 2.11/builder |
17 | 25 | steps: |
18 | 26 | - uses: actions/checkout@master |
19 | | - - name: non-master build test |
| 27 | + - name: non-master build test (per-path) |
20 | 28 | run: | |
21 | | - docker build -f 2.10/alpine/Dockerfile 2.10/alpine |
22 | | - docker build -f 2.10/builder/Dockerfile 2.10/builder |
| 29 | + docker build -f ${{ matrix.path }}/Dockerfile ${{ matrix.path }} |
23 | 30 | if: github.repository != 'caddyserver/caddy-docker' || github.ref != 'refs/heads/master' |
| 31 | + |
| 32 | + # Main linux bashbrew build. |
| 33 | + docker-linux-build: |
| 34 | + runs-on: ubuntu-latest |
| 35 | + container: |
| 36 | + image: hairyhenderson/dockerfiles-builder:latest |
| 37 | + env: |
| 38 | + BASHBREW_LIBRARY: ./library |
| 39 | + BASHBREW_NAMESPACE: caddy |
| 40 | + DOCKER_BUILDKIT: '1' |
| 41 | + needs: linux-dockerfile-test |
| 42 | + steps: |
| 43 | + - uses: actions/checkout@master |
| 44 | + |
24 | 45 | - name: build |
25 | 46 | run: bashbrew build caddy |
| 47 | + |
26 | 48 | - name: push |
| 49 | + if: github.repository == 'caddyserver/caddy-docker' && github.ref == 'refs/heads/master' |
27 | 50 | # NOTE: DOCKERHUB_TOKEN and DOCKERHUB_USERNAME must be present in https://github.com/caddyserver/caddy-docker/settings |
28 | 51 | # the user must have permission to push to https://hub.docker.com/r/caddy/caddy |
29 | 52 | run: | |
30 | 53 | echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login --username ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin |
31 | 54 | bashbrew push caddy |
32 | | - if: github.repository == 'caddyserver/caddy-docker' && github.ref == 'refs/heads/master' |
| 55 | +
|
33 | 56 | - name: push (non-master dry run) |
| 57 | + if: github.repository != 'caddyserver/caddy-docker' || github.ref != 'refs/heads/master' |
34 | 58 | run: | |
35 | 59 | bashbrew push --dry-run caddy |
36 | | - if: github.repository != 'caddyserver/caddy-docker' || github.ref != 'refs/heads/master' |
37 | 60 |
|
38 | | - docker-windows-build: |
39 | | - runs-on: windows-2022 |
40 | | - # env: |
41 | | - # BASHBREW_LIBRARY: ./library |
42 | | - # BASHBREW_NAMESPACE: caddy |
| 61 | +
|
| 62 | + # Parallelized: run quick windows docker build tests per-Dockerfile in parallel |
| 63 | + windows-dockerfile-test: |
| 64 | + runs-on: ${{ matrix.runner }} |
| 65 | + strategy: |
| 66 | + matrix: |
| 67 | + include: |
| 68 | + - path: 2.10/windows/ltsc2022 |
| 69 | + runner: windows-2022 |
| 70 | + - path: 2.10/windows-nanoserver/ltsc2022 |
| 71 | + runner: windows-2022 |
| 72 | + - path: 2.10/windows/ltsc2025 |
| 73 | + runner: windows-2025 |
| 74 | + - path: 2.10/windows-nanoserver/ltsc2025 |
| 75 | + runner: windows-2025 |
| 76 | + - path: 2.11/windows/ltsc2022 |
| 77 | + runner: windows-2022 |
| 78 | + - path: 2.11/windows-nanoserver/ltsc2022 |
| 79 | + runner: windows-2022 |
| 80 | + - path: 2.11/windows/ltsc2025 |
| 81 | + runner: windows-2025 |
| 82 | + - path: 2.11/windows-nanoserver/ltsc2025 |
| 83 | + runner: windows-2025 |
43 | 84 | steps: |
44 | 85 | - uses: actions/checkout@master |
45 | | - - name: non-master build test |
46 | | - run: | |
47 | | - docker build -f 2.10/windows/ltsc2022/Dockerfile 2.10/windows/ltsc2022 |
48 | | - docker build -f 2.10/windows-nanoserver/ltsc2022/Dockerfile 2.10/windows-nanoserver/ltsc2022 |
| 86 | + - name: non-master build test (per-path) |
49 | 87 | if: github.repository != 'caddyserver/caddy-docker' || github.ref != 'refs/heads/master' |
| 88 | + run: | |
| 89 | + docker build -f ${{ matrix.path }}/Dockerfile ${{ matrix.path }} |
| 90 | +
|
| 91 | + # Main windows build (matrix over constraints) - runs after tests |
| 92 | + windows-build: |
| 93 | + needs: windows-dockerfile-test |
| 94 | + runs-on: ${{ matrix.runner }} |
| 95 | + strategy: |
| 96 | + matrix: |
| 97 | + include: |
| 98 | + - constraint: windowsservercore-ltsc2022 |
| 99 | + runner: windows-2022 |
| 100 | + - constraint: windowsnanoserver-ltsc2022 |
| 101 | + runner: windows-2022 |
| 102 | + - constraint: windowsservercore-ltsc2025 |
| 103 | + runner: windows-2025 |
| 104 | + - constraint: windowsnanoserver-ltsc2025 |
| 105 | + runner: windows-2025 |
| 106 | + steps: |
| 107 | + - uses: actions/checkout@master |
| 108 | + |
50 | 109 | - name: install bashbrew |
51 | 110 | run: curl -o /bashbrew.exe https://doi-janky.infosiftr.net/job/bashbrew/job/master/lastSuccessfulBuild/artifact/bashbrew-windows-amd64.exe |
| 111 | + |
52 | 112 | - name: build |
53 | 113 | run: | |
54 | | - /bashbrew --arch windows-amd64 --constraint windowsservercore-ltsc2022 --namespace caddy --library ./library build caddy; |
55 | | - /bashbrew --arch windows-amd64 --constraint windowsnanoserver-ltsc2022 --namespace caddy --library ./library build caddy |
| 114 | + /bashbrew --arch windows-amd64 --constraint ${{ matrix.constraint }} --namespace caddy --library ./library build caddy |
| 115 | +
|
56 | 116 | - name: push |
| 117 | + if: github.repository == 'caddyserver/caddy-docker' && github.ref == 'refs/heads/master' |
57 | 118 | # NOTE: DOCKERHUB_TOKEN and DOCKERHUB_USERNAME must be present in https://github.com/caddyserver/caddy-docker/settings |
58 | 119 | # the user must have permission to push to https://hub.docker.com/r/caddy/caddy |
59 | 120 | run: | |
60 | 121 | echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login --username ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin; |
61 | | - /bashbrew --arch windows-amd64 --constraint windowsservercore-ltsc2022 --namespace caddy --library ./library push caddy; |
62 | | - /bashbrew --arch windows-amd64 --constraint windowsnanoserver-ltsc2022 --namespace caddy --library ./library push caddy |
63 | | - if: github.repository == 'caddyserver/caddy-docker' && github.ref == 'refs/heads/master' |
| 122 | + /bashbrew --arch windows-amd64 --constraint ${{ matrix.constraint }} --namespace caddy --library ./library push caddy |
| 123 | +
|
64 | 124 | - name: push (non-master dry run) |
65 | | - run: | |
66 | | - /bashbrew --arch windows-amd64 --constraint windowsservercore-ltsc2022 --namespace caddy --library ./library push --dry-run caddy; |
67 | | - /bashbrew --arch windows-amd64 --constraint windowsnanoserver-ltsc2022 --namespace caddy --library ./library push --dry-run caddy |
68 | 125 | if: github.repository != 'caddyserver/caddy-docker' || github.ref != 'refs/heads/master' |
| 126 | + run: | |
| 127 | + /bashbrew --arch windows-amd64 --constraint ${{ matrix.constraint }} --namespace caddy --library ./library push --dry-run caddy |
| 128 | +
|
0 commit comments