Skip to content

Commit bafd4ea

Browse files
authored
Merge pull request #4789 from manyfold3d/docker-build-matrix
Combine standard and solo docker builds more efficiently
2 parents 1037dc8 + 4a7fe2a commit bafd4ea

File tree

2 files changed

+9
-49
lines changed

2 files changed

+9
-49
lines changed

.github/workflows/docker.yml

Lines changed: 9 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ on:
1919

2020
jobs:
2121
build:
22+
strategy:
23+
fail-fast: true
24+
max-parallel: 1
25+
matrix:
26+
variant:
27+
- manyfold
28+
- manyfold-solo
2229
runs-on: ubuntu-latest
2330
permissions:
2431
contents: read # for checkout
@@ -32,7 +39,7 @@ jobs:
3239
id: docker_meta
3340
uses: docker/metadata-action@v5
3441
with:
35-
images: ghcr.io/${{ github.repository }}
42+
images: ghcr.io/${{ github.repository_owner }}/${{ matrix.variant }}
3643
tags: |
3744
type=raw,value=${{ inputs.tag }},event=workflow_dispatch
3845
type=schedule,pattern=nightly
@@ -56,7 +63,7 @@ jobs:
5663
with:
5764
project: bsbhgkfhgc
5865
context: .
59-
file: ./docker/manyfold.dockerfile
66+
file: ./docker/${{ matrix.variant }}.dockerfile
6067
platforms: linux/amd64,linux/arm64
6168
push: ${{ github.event_name != 'pull_request' }}
6269
tags: ${{ steps.docker_meta.outputs.tags }}
@@ -65,50 +72,3 @@ jobs:
6572
APP_VERSION=${{ steps.docker_meta.outputs.version }}
6673
GIT_SHA=${{ github.sha }}
6774
DOCKER_TAG=${{ steps.docker_meta.outputs.tags }}
68-
69-
solo:
70-
runs-on: ubuntu-latest
71-
permissions:
72-
contents: read # for checkout
73-
id-token: write # for OIDC token, used for Depot
74-
packages: write # to upload build to GHCR
75-
steps:
76-
- name: Check out code
77-
uses: actions/checkout@v5
78-
79-
- name: Work out Docker tags
80-
id: docker_meta
81-
uses: docker/metadata-action@v5
82-
with:
83-
images: ghcr.io/${{ github.repository }}-solo
84-
tags: |
85-
type=raw,value=${{ inputs.tag }},event=workflow_dispatch
86-
type=schedule,pattern=nightly
87-
type=semver,pattern={{version}}
88-
type=ref,event=pr
89-
type=edge
90-
91-
- name: Depot setup
92-
uses: depot/setup-action@v1
93-
94-
- name: Login to GitHub Container Registry
95-
uses: docker/login-action@v3
96-
with:
97-
registry: ghcr.io
98-
username: ${{ github.repository_owner }}
99-
password: ${{ secrets.GITHUB_TOKEN }}
100-
101-
- name: Build and push
102-
id: depot
103-
uses: depot/build-push-action@v1
104-
with:
105-
project: bsbhgkfhgc
106-
context: .
107-
file: ./docker/solo.dockerfile
108-
platforms: linux/amd64,linux/arm64
109-
push: ${{ github.event_name != 'pull_request' }}
110-
tags: ${{ steps.docker_meta.outputs.tags }}
111-
labels: ${{ steps.docker_meta.outputs.labels }}
112-
build-args: |
113-
APP_VERSION=${{ steps.docker_meta.outputs.version }}
114-
GIT_SHA=${{ github.sha }}
File renamed without changes.

0 commit comments

Comments
 (0)