diff --git a/.github/workflows/dockerimage.yml b/.github/workflows/dockerimage.yml index 30b9420..76d6a12 100644 --- a/.github/workflows/dockerimage.yml +++ b/.github/workflows/dockerimage.yml @@ -12,7 +12,21 @@ env: jobs: build: - runs-on: ubuntu-latest + strategy: + matrix: + os: + - ubuntu-24.04 + - ubuntu-24.04-arm + platform: + - amd64 + - arm64 + exclude: + - os: ubuntu-24.04 + platform: arm64 + - os: ubuntu-24.04-arm + platform: amd64 + + runs-on: ${{ matrix.os }} steps: - name: Checkout @@ -20,6 +34,8 @@ jobs: - name: ccache uses: hendrikmuhs/ccache-action@v1.2 + with: + key: ${{ matrix.os }}-${{ matrix.platform }} - name: Get latest node version run: echo "LATEST_VERSION=$(curl -fsSLo- --compressed https://nodejs.org/dist/index.json | jq '.[].version' | tr -d '"' | tr -d 'v' | head -1)" >> $GITHUB_ENV @@ -42,6 +58,7 @@ jobs: uses: docker/build-push-action@v6 with: context: . + platforms: linux/${{ matrix.platform }} load: true tags: ${{ env.IMAGE_NAME }}-${{ env.LATEST_VERSION }} diff --git a/.github/workflows/update-current-image.yml b/.github/workflows/update-current-image.yml index b36561e..3ec6f05 100644 --- a/.github/workflows/update-current-image.yml +++ b/.github/workflows/update-current-image.yml @@ -24,17 +24,35 @@ jobs: run: echo ${{ steps.get_version.outputs.NODE_VERSION }} build_push: + strategy: + matrix: + os: + - ubuntu-24.04 + - ubuntu-24.04-arm + platform: + - amd64 + - arm64 + exclude: + - os: ubuntu-24.04 + platform: arm64 + - os: ubuntu-24.04-arm + platform: amd64 + needs: check_version - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + if: needs.check_version.outputs.NODE_VERSION env: NODE_VERSION: ${{needs.check_version.outputs.NODE_VERSION}} + steps: - name: Checkout uses: actions/checkout@v4 - name: ccache uses: hendrikmuhs/ccache-action@v1.2 + with: + key: ${{ matrix.os }}-${{ matrix.platform }} - name: Show NODE_VERSION run: echo $NODE_VERION @@ -65,6 +83,7 @@ jobs: DOCKER_BUILD_SUMMARY: false with: context: . + platforms: linux/${{ matrix.platform }} load: true tags: ${{ env.IMAGE_NAME }}-${{ needs.check_version.outputs.NODE_VERSION }} @@ -99,7 +118,7 @@ jobs: uses: docker/build-push-action@v6 with: context: . - platforms: linux/amd64 + platforms: linux/${{ matrix.platform }} push: true provenance: mode=max sbom: true