Skip to content

Commit

Permalink
chore: use arm64 runners for docker
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Jan 24, 2025
1 parent f7311fd commit 3e00a3b
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 19 deletions.
106 changes: 92 additions & 14 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,29 +103,107 @@ jobs:
max_attempts: 3
command: mise run test
dockerhub:
runs-on: ubuntu-latest
runs-on: ${{ matrix.platform.os }}
strategy:
fail-fast: false
matrix:
platform:
- os: ubuntu-latest
tag_suffix: amd64
platform: linux/amd64
- os: ubuntu-24.04-arm
tag_suffix: arm64
platform: linux/arm64
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Prepare
run: |
platform=${{ matrix.platform.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
jdxcode/mise
ghcr.io/jdx/mise
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: jdxcode
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
- name: Build and push by digest
id: build
uses: docker/build-push-action@v6
with:
platforms: ${{ matrix.platform.platform }}
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,"name=jdxcode/mise,ghcr.io/jdx/mise",push-by-digest=true,name-canonical=true,push=true
- name: Export digest
run: |
mkdir -p ${{ runner.temp }}/digests
digest="${{ steps.build.outputs.digest }}"
touch "${{ runner.temp }}/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v4
with:
name: digests-${{ env.PLATFORM_PAIR }}
path: ${{ runner.temp }}/digests/*
if-no-files-found: error
retention-days: 1
merge:
runs-on: ubuntu-latest
needs: [dockerhub]
steps:
- name: Download digests
uses: actions/download-artifact@v4
with:
path: ${{ runner.temp }}/digests
pattern: digests-*
merge-multiple: true
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
username: jdxcode
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: jdx
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: jdxcode/mise
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: jdxcode/mise:latest,jdxcode/mise:${{ github.ref_name }}
labels: ${{ steps.meta.outputs.labels }}
images: |
jdxcode/mise
ghcr.io/jdx/mise
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Create manifest list and push
working-directory: ${{ runner.temp }}/digests
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf 'jdxcode/mise:${{ github.ref_name }}@sha256:%s ' *)
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf 'ghcr.io/jdx/mise:${{ github.ref_name }}@sha256:%s ' *)
- name: Inspect image
run: |
docker buildx imagetools inspect jdxcode/mise:${{ steps.meta.outputs.version }}
docker buildx imagetools inspect ghcr.io/jdx/mise:${{ steps.meta.outputs.version }}
7 changes: 2 additions & 5 deletions mise.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
[tools.actionlint]
version = "1.7.6"
version = "1.7.7"
backend = "aqua:rhysd/actionlint"

[tools.actionlint.checksums]
actionlint-linux-x86_64 = "sha256:bf567ce887b8b045fdd6001411aea1971e90a49e4f5172801fb648902843c9ec"
actionlint-macos-aarch64 = "sha256:baa69aa6ae140310d9d86127d916abd42cd2ad446aef0a04f2a7fe7f54da7d67"
"actionlint_1.7.6_darwin_arm64.tar.gz" = "sha256:9a7c9cb2b627bb137ef68742eead2dd5b78f3ddc44876e84c37d323ba28b4710"
"actionlint_1.7.6_linux_amd64.tar.gz" = "sha256:5d1a70d9de15fee5371e6f9e20cc29b284e814d6ee1b882f9749e91caf716eba"
"actionlint_1.7.7_darwin_arm64.tar.gz" = "sha256:2693315b9093aeacb4ebd91a993fea54fc215057bf0da2659056b4bc033873db"

[tools.bun]
version = "1.1.44"
Expand Down
3 changes: 3 additions & 0 deletions packaging/mise/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# syntax=docker/dockerfile:1
FROM rust AS builder
LABEL maintainer="jdx"
LABEL org.opencontainers.image.source=https://github.com/jdx/mise
LABEL org.opencontainers.image.description="mise is a tool for managing your development environment"
LABEL org.opencontainers.image.licenses=MIT

WORKDIR /usr/src/mise
COPY . /usr/src/mise/
Expand Down

0 comments on commit 3e00a3b

Please sign in to comment.