Skip to content

Commit aa61861

Browse files
committed
chore: Refactor Docker build process to use matrix strategy for multiple Android versions
1 parent 10fd29c commit aa61861

1 file changed

Lines changed: 19 additions & 25 deletions

File tree

.github/workflows/docker-publish.yml

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,19 @@ env:
1717

1818
jobs:
1919
build:
20-
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
include:
24+
- android_version: '33'
25+
context: android/33-node
26+
suffix: -33-node
27+
- android_version: '34'
28+
context: android/34-node
29+
suffix: -34-node
30+
- android_version: '35'
31+
context: android/35-node
32+
suffix: -35-node
2133
runs-on: ubuntu-latest
2234
permissions:
2335
contents: read
@@ -59,6 +71,8 @@ jobs:
5971
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
6072
with:
6173
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
74+
flavor: |
75+
suffix=${{ matrix.suffix }},onlatest=false
6276
tags: |
6377
type=schedule
6478
type=ref,event=branch
@@ -74,32 +88,12 @@ jobs:
7488
id: build-and-push
7589
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
7690
with:
77-
context: android/33-node
78-
push: ${{ github.event_name != 'pull_request' }}
79-
tags: ${{ steps.meta.outputs.tags }}-33-node
80-
labels: ${{ steps.meta.outputs.labels }}
81-
cache-from: type=gha
82-
cache-to: type=gha,mode=max
83-
- name: Build and push Docker image 34
84-
id: build-and-push-34
85-
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
86-
with:
87-
context: android/34-node
88-
push: ${{ github.event_name != 'pull_request' }}
89-
tags: ${{ steps.meta.outputs.tags }}-34-node
90-
labels: ${{ steps.meta.outputs.labels }}
91-
cache-from: type=gha
92-
cache-to: type=gha,mode=max
93-
- name: Build and push Docker image 35
94-
id: build-and-push-35
95-
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
96-
with:
97-
context: android/35-node
91+
context: ${{ matrix.context }}
9892
push: ${{ github.event_name != 'pull_request' }}
99-
tags: ${{ steps.meta.outputs.tags }}-35-node
93+
tags: ${{ steps.meta.outputs.tags }}
10094
labels: ${{ steps.meta.outputs.labels }}
101-
cache-from: type=gha
102-
cache-to: type=gha,mode=max
95+
cache-from: type=gha,scope=${{ matrix.android_version }}-node
96+
cache-to: type=gha,mode=max,scope=${{ matrix.android_version }}-node
10397

10498

10599
# Sign the resulting Docker image digest except on PRs.

0 commit comments

Comments
 (0)