v0.5.1 #112
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish Docker image | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| build_amd64: | |
| name: Build AMD64 image | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - image_name: junobuild/satellite | |
| cli_build: satellite | |
| - image_name: junobuild/console | |
| cli_build: console | |
| - image_name: junobuild/skylab | |
| cli_build: skylab | |
| steps: | |
| - name: Check out the repo | |
| uses: actions/checkout@v4 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Build and push AMD64 | |
| uses: ./.github/actions/build-push | |
| with: | |
| image_name: ${{ matrix.image_name }} | |
| cli_build: ${{ matrix.cli_build }} | |
| platform: linux/amd64 | |
| tag_suffix: amd64 | |
| docker_username: ${{ secrets.DOCKER_USERNAME }} | |
| docker_token: ${{ secrets.DOCKER_TOKEN }} | |
| build_arm64: | |
| name: Build ARM64 image | |
| runs-on: ubuntu-24.04-arm | |
| strategy: | |
| matrix: | |
| include: | |
| - image_name: junobuild/satellite | |
| cli_build: satellite | |
| - image_name: junobuild/console | |
| cli_build: console | |
| - image_name: junobuild/skylab | |
| cli_build: skylab | |
| steps: | |
| - name: Check out the repo | |
| uses: actions/checkout@v4 | |
| - name: Build and push ARM64 | |
| uses: ./.github/actions/build-push | |
| with: | |
| image_name: ${{ matrix.image_name }} | |
| cli_build: ${{ matrix.cli_build }} | |
| platform: linux/arm64 | |
| tag_suffix: arm64 | |
| docker_username: ${{ secrets.DOCKER_USERNAME }} | |
| docker_token: ${{ secrets.DOCKER_TOKEN }} | |
| merge: | |
| name: Merge multi-arch image | |
| runs-on: ubuntu-latest | |
| needs: [build_amd64, build_arm64] | |
| strategy: | |
| matrix: | |
| include: | |
| - image_name: junobuild/satellite | |
| - image_name: junobuild/console | |
| - image_name: junobuild/skylab | |
| steps: | |
| - name: Check out the repo | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@v2 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_TOKEN }} | |
| - name: Extract metadata | |
| id: meta | |
| uses: docker/metadata-action@v4 | |
| with: | |
| images: ${{ matrix.image_name }} | |
| tags: | | |
| type=semver,pattern={{major}} | |
| type=semver,pattern={{version}} | |
| type=raw,value=latest | |
| - name: Pull images before merge | |
| run: | | |
| for tag in $(echo "${{ steps.meta.outputs.tags }}" | tr ',' ' '); do | |
| docker pull --platform=linux/amd64 "${tag}-amd64" | |
| docker pull --platform=linux/arm64 "${tag}-arm64" | |
| done | |
| - name: Merge AMD64 and ARM64 images | |
| run: | | |
| for tag in $(echo "${{ steps.meta.outputs.tags }}" | tr ',' ' '); do | |
| arch_tag_amd64="${tag}-amd64" | |
| arch_tag_arm64="${tag}-arm64" | |
| docker buildx imagetools create \ | |
| --tag "$tag" \ | |
| "$arch_tag_amd64" \ | |
| "$arch_tag_arm64" | |
| done |