Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(docker): build both amd64 and arm64 images, and an Alpine-based one #956

Merged
merged 2 commits into from
Nov 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 54 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ jobs:
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

deploy_image:
name: 'Publish: DockerHub'
deploy_image_debian:
name: 'Publish: Debian to DockerHub'
runs-on: ubuntu-latest
needs: [jest, tox]
if: github.event_name == 'release' || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master'
Expand Down Expand Up @@ -169,5 +169,57 @@ jobs:
uses: docker/build-push-action@v2
with:
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.release_meta.outputs.tags || steps.edge_meta.outputs.tags }}
labels: ${{ steps.release_meta.outputs.labels || steps.edge_meta.outputs.tags }}

deploy_image_alpine:
name: 'Publish: Alpine to DockerHub'
runs-on: ubuntu-latest
needs: [jest, tox]
if: github.event_name == 'release' || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master'
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch

- name: Generating release tags and labels
if: github.event_name == 'release'
id: release_meta
uses: docker/metadata-action@v4
with:
images: jaedb/iris
tags: |
latest-alpine
type=semver,pattern={{version}}-alpine
type=semver,pattern={{major}}.{{minor}}-alpine

- name: Generating edge branch labels
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master'
id: edge_meta
uses: docker/metadata-action@v4
with:
images: jaedb/iris
tags: ${{ steps.extract_branch.outputs.branch }}

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v2
with:
push: true
platforms: linux/amd64,linux/arm64
file: "{{context}}/Dockerfile.alpine"
tags: ${{ steps.release_meta.outputs.tags || steps.edge_meta.outputs.tags }}
labels: ${{ steps.release_meta.outputs.labels || steps.edge_meta.outputs.tags }}