Skip to content

Commit 3c9cc49

Browse files
committed
add matrix build for alpine+ubuntu
1 parent 1fd290f commit 3c9cc49

File tree

3 files changed

+32
-6
lines changed

3 files changed

+32
-6
lines changed

.github/workflows/docker-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
needs: release-container-prereq
4242
uses: ./.github/workflows/reusable-container-workflow.yaml
4343
with:
44-
dockerfile: tools/docker/Dockerfile.ubuntu-prod
44+
dockerfile: prod
4545
tag: ${{ needs.release-container-prereq.outputs.tag }}
4646
tag_latest: ${{ needs.release-container-prereq.outputs.tag_latest == 'true' }}
4747
image: ghcr.io/${{ github.repository }}

.github/workflows/docker-weekly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
weekly-container-build:
1616
uses: ./.github/workflows/reusable-container-workflow.yaml
1717
with:
18-
dockerfile: tools/docker/Dockerfile.ubuntu-dev
18+
dockerfile: dev
1919
tag: alpha
2020
image: ghcr.io/${{ github.repository }}
2121
registry: ghcr.io

.github/workflows/reusable-container-workflow.yaml

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@ on:
3737
jobs:
3838
container-build:
3939
runs-on: ubuntu-latest
40+
strategy:
41+
matrix:
42+
include:
43+
- tag: alpine
44+
dockerfile: tools/docker/Dockerfile.alpine
45+
tag_main: 'false'
46+
- tag: ubuntu
47+
dockerfile: tools/docker/Dockerfile.ubuntu
48+
tag_main: 'true'
4049
steps:
4150
- name: checkout
4251
uses: actions/checkout@v3
@@ -79,7 +88,8 @@ jobs:
7988
username: ${{ inputs.registry_username }}
8089
password: ${{ secrets.registry_password }}
8190

82-
- name: Docker meta
91+
- if: matrix.tag_main == 'true'
92+
name: Docker meta
8393
id: metadata
8494
uses: docker/metadata-action@v3
8595
with:
@@ -88,7 +98,21 @@ jobs:
8898
tags: |
8999
type=raw,value=latest,enable=${{ inputs.tag_latest }}
90100
type=raw,value=${{ inputs.tag }}
91-
type=raw,value=${{ inputs.release_version }}
101+
type=raw,value=${{ inputs.tag }}-${{ matrix.tag }}
102+
type=raw,value=${{ inputs.release_version }},enable=${{ inputs.release_version != '' }}
103+
type=raw,value=${{ inputs.release_version }}-${{ matrix.tag }},enable=${{ inputs.release_version != '' }}
104+
105+
- if: matrix.tag_main == 'false'
106+
name: Docker meta
107+
id: metadata2
108+
uses: docker/metadata-action@v3
109+
with:
110+
images: |
111+
${{ inputs.image }}
112+
tags: |
113+
type=raw,value=${{ inputs.tag }}-${{ matrix.tag }}
114+
type=raw,value=${{ inputs.release_version }},enable=${{ inputs.release_version != '' }}
115+
type=raw,value=${{ inputs.release_version }}-${{ matrix.tag }},enable=${{ inputs.release_version != '' }}
92116
93117
- name: Build release image
94118
uses: docker/build-push-action@v3
@@ -98,8 +122,10 @@ jobs:
98122
build-args: |
99123
QEMU_CPU=max,pauth-impdef=on
100124
push: true
101-
tags: ${{ steps.metadata.outputs.tags }}
125+
tags: |
126+
${{ steps.metadata.outputs.tags }}
127+
${{ steps.metadata2.outputs.tags }}
102128
labels: ${{ steps.metadata.outputs.labels }}
103-
file: ${{ inputs.dockerfile }}
129+
file: ${{ matrix.dockerfile }}-${{ inputs.dockerfile }}
104130
cache-from: type=gha
105131
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)