Skip to content

Commit

Permalink
Publish arm docker images as part of the release process
Browse files Browse the repository at this point in the history
  • Loading branch information
noituri committed Jan 8, 2025
1 parent 97405df commit 283dbd0
Showing 1 changed file with 72 additions and 2 deletions.
74 changes: 72 additions & 2 deletions .github/workflows/package_for_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ jobs:
name: smelter_with_web_renderer_darwin_aarch64.tar.gz
path: smelter_with_web_renderer_darwin_aarch64.tar.gz

docker:
docker-amd64:
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout repo
Expand All @@ -145,7 +145,42 @@ jobs:
- name: 📤 Upload image
run: docker push ghcr.io/software-mansion/smelter:${{ github.sha }}

docker-with-web-renderer:
docker-arm64:
needs: docker-amd64
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout repo
uses: actions/checkout@v4

- name: 🛠️ Setup Docker
run: |
docker run --privileged --rm tonistiigi/binfmt --install all
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: 🎣 Pull Smleter AMD64 image
run: |
docker pull ghcr.io/software-mansion/smelter:${{ github.sha }}
echo "AMD64_IMAGE_ID=$(docker inspect --format='{{index .RepoDigests 0}}' ghcr.io/software-mansion/smelter:${{ github.sha }})" >> "$GITHUB_ENV"
- name: 🔨 Build Smelter ARM64 image
run: |
docker buildx build --platform linux/arm64 -t ghcr.io/software-mansion/smelter:${{ github.sha }} -f build_tools/docker/slim.Dockerfile .
- name: ⏩ Push ARM64 image
run: |
docker push ghcr.io/software-mansion/smelter:${{ github.sha }}
echo "ARM64_IMAGE_ID=$(docker inspect --format='{{index .RepoDigests 0}}' ghcr.io/software-mansion/smelter:${{ github.sha }})" >> "$GITHUB_ENV"
- name: 🔗 Merge AMD64 and ARM64 images
run: |
docker manifest create ghcr.io/software-mansion/smelter:${{ github.sha }} ${{ env.AMD64_IMAGE_ID }} ${{ env.ARM64_IMAGE_ID }}
docker manifest annotate ghcr.io/software-mansion/smelter:${{ github.sha }} ${{ env.AMD64_IMAGE_ID }} --arch amd64
docker manifest annotate ghcr.io/software-mansion/smelter:${{ github.sha }} ${{ env.ARM64_IMAGE_ID }} --arch arm64
- name: 📤 Upload image
run: docker manifest push ghcr.io/software-mansion/smelter:${{ github.sha }}

docker-with-web-renderer-amd64:
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout repo
Expand All @@ -161,3 +196,38 @@ jobs:
- name: 📤 Upload image
run: docker push ghcr.io/software-mansion/smelter:${{ github.sha }}-web-renderer

docker-with-web-renderer-arm64:
needs: docker-with-web-renderer-amd64
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout repo
uses: actions/checkout@v4

- name: 🛠️ Setup Docker
run: |
docker run --privileged --rm tonistiigi/binfmt --install all
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: 🎣 Pull Smleter AMD64 image
run: |
docker pull ghcr.io/software-mansion/smelter:${{ github.sha }}-web-renderer
echo "AMD64_IMAGE_ID=$(docker inspect --format='{{index .RepoDigests 0}}' ghcr.io/software-mansion/smelter:${{ github.sha }}-web-renderer)" >> "$GITHUB_ENV"
- name: 🔨 Build Smelter ARM64 image
run: |
docker buildx build --platform linux/arm64 -t ghcr.io/software-mansion/smelter:${{ github.sha }}-web-renderer -f build_tools/docker/full.Dockerfile .
- name: ⏩ Push ARM64 image
run: |
docker push ghcr.io/software-mansion/smelter:${{ github.sha }}-web-renderer
echo "ARM64_IMAGE_ID=$(docker inspect --format='{{index .RepoDigests 0}}' ghcr.io/software-mansion/smelter:${{ github.sha }}-web-renderer)" >> "$GITHUB_ENV"
- name: 🔗 Merge AMD64 and ARM64 images
run: |
docker manifest create ghcr.io/software-mansion/smelter:${{ github.sha }}-web-renderer ${{ env.AMD64_IMAGE_ID }} ${{ env.ARM64_IMAGE_ID }}
docker manifest annotate ghcr.io/software-mansion/smelter:${{ github.sha }}-web-renderer ${{ env.AMD64_IMAGE_ID }} --arch amd64
docker manifest annotate ghcr.io/software-mansion/smelter:${{ github.sha }}-web-renderer ${{ env.ARM64_IMAGE_ID }} --arch arm64
- name: 📤 Upload image
run: docker manifest push ghcr.io/software-mansion/smelter:${{ github.sha }}-web-renderer

0 comments on commit 283dbd0

Please sign in to comment.