Skip to content

Commit 29ef336

Browse files
authored
Merge pull request #956 from PureTryOut/feat/alpine-image
feat(docker): build both amd64 and arm64 images, and an Alpine-based one
2 parents b957b20 + 71f03e9 commit 29ef336

File tree

1 file changed

+54
-2
lines changed

1 file changed

+54
-2
lines changed

.github/workflows/ci.yml

+54-2
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ jobs:
123123
- name: Image digest
124124
run: echo ${{ steps.docker_build.outputs.digest }}
125125

126-
deploy_image:
127-
name: 'Publish: DockerHub'
126+
deploy_image_debian:
127+
name: 'Publish: Debian to DockerHub'
128128
runs-on: ubuntu-latest
129129
needs: [jest, tox]
130130
if: github.event_name == 'release' || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master'
@@ -169,5 +169,57 @@ jobs:
169169
uses: docker/build-push-action@v2
170170
with:
171171
push: true
172+
platforms: linux/amd64,linux/arm64
173+
tags: ${{ steps.release_meta.outputs.tags || steps.edge_meta.outputs.tags }}
174+
labels: ${{ steps.release_meta.outputs.labels || steps.edge_meta.outputs.tags }}
175+
176+
deploy_image_alpine:
177+
name: 'Publish: Alpine to DockerHub'
178+
runs-on: ubuntu-latest
179+
needs: [jest, tox]
180+
if: github.event_name == 'release' || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master'
181+
steps:
182+
- name: Set up QEMU
183+
uses: docker/setup-qemu-action@v1
184+
185+
- name: Set up Docker Buildx
186+
uses: docker/setup-buildx-action@v1
187+
188+
- name: Extract branch name
189+
shell: bash
190+
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
191+
id: extract_branch
192+
193+
- name: Generating release tags and labels
194+
if: github.event_name == 'release'
195+
id: release_meta
196+
uses: docker/metadata-action@v4
197+
with:
198+
images: jaedb/iris
199+
tags: |
200+
latest-alpine
201+
type=semver,pattern={{version}}-alpine
202+
type=semver,pattern={{major}}.{{minor}}-alpine
203+
204+
- name: Generating edge branch labels
205+
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master'
206+
id: edge_meta
207+
uses: docker/metadata-action@v4
208+
with:
209+
images: jaedb/iris
210+
tags: ${{ steps.extract_branch.outputs.branch }}
211+
212+
- name: Login to DockerHub
213+
uses: docker/login-action@v1
214+
with:
215+
username: ${{ secrets.DOCKERHUB_USERNAME }}
216+
password: ${{ secrets.DOCKERHUB_TOKEN }}
217+
218+
- name: Build and push
219+
uses: docker/build-push-action@v2
220+
with:
221+
push: true
222+
platforms: linux/amd64,linux/arm64
223+
file: "{{context}}/Dockerfile.alpine"
172224
tags: ${{ steps.release_meta.outputs.tags || steps.edge_meta.outputs.tags }}
173225
labels: ${{ steps.release_meta.outputs.labels || steps.edge_meta.outputs.tags }}

0 commit comments

Comments
 (0)