Skip to content

Commit b907716

Browse files
committed
build amd64 for alpine
1 parent 61094bf commit b907716

File tree

3 files changed

+50
-6
lines changed

3 files changed

+50
-6
lines changed

.github/actions/build/action.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ inputs:
44
file:
55
description: Dockerfile
66
required: true
7+
platforms:
8+
description: Docker build platform(s)
9+
default: linux/amd64,linux/arm64
10+
push:
11+
description: Push image to Docker hub
12+
default: "false"
713
runs:
814
using: composite
915
steps:
@@ -28,5 +34,6 @@ runs:
2834
- uses: docker/build-push-action@v5
2935
with:
3036
file: ${{ inputs.file }}
31-
platforms: linux/amd64,linux/arm64
37+
platforms: ${{ inputs.platforms }}
38+
push: ${{ inputs.push }}
3239
tags: ${{ steps.meta.outputs.tags }}

.github/workflows/build.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- Dockerfile*
88
- Pipfile.lock
99
jobs:
10-
build:
10+
build-multiarch:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
@@ -26,3 +26,20 @@ jobs:
2626
uses: ./.github/actions/build
2727
with:
2828
file: ${{ matrix.file }}
29+
build-amd64:
30+
runs-on: ubuntu-latest
31+
strategy:
32+
matrix:
33+
file:
34+
- Dockerfile.alpine
35+
steps:
36+
- uses: actions/checkout@v3
37+
- name: lint ${{ matrix.file }}
38+
uses: ./.github/actions/lint
39+
with:
40+
file: ${{ matrix.file }}
41+
- name: build ${{ matrix.file }}
42+
uses: ./.github/actions/build
43+
with:
44+
file: ${{ matrix.file }}
45+
platforms: linux/amd64

.github/workflows/push.yml

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ on:
44
tags:
55
- "*"
66
jobs:
7-
build-push:
7+
build-push-multiarch:
88
runs-on: ubuntu-latest
99
strategy:
1010
matrix:
1111
file:
1212
- Dockerfile
13-
- Dockerfile.alpine
1413
- Dockerfile.jupyter
1514
- Dockerfile.slim
1615
steps:
@@ -27,5 +26,26 @@ jobs:
2726
uses: ./.github/actions/build
2827
with:
2928
file: ${{ matrix.file }}
30-
platform: ${{ matrix.platform }}
31-
- run: make push
29+
push: true
30+
build-push-amd64:
31+
runs-on: ubuntu-latest
32+
strategy:
33+
matrix:
34+
file:
35+
- Dockerfile.alpine
36+
steps:
37+
- uses: actions/checkout@v3
38+
- uses: docker/login-action@v1
39+
with:
40+
username: ${{ secrets.DOCKERHUB_USERNAME }}
41+
password: ${{ secrets.DOCKERHUB_TOKEN }}
42+
- name: lint ${{ matrix.file }}
43+
uses: ./.github/actions/lint
44+
with:
45+
file: ${{ matrix.file }}
46+
- name: build ${{ matrix.file }}
47+
uses: ./.github/actions/build
48+
with:
49+
file: ${{ matrix.file }}
50+
platforms: linux/amd64
51+
push: true

0 commit comments

Comments
 (0)