From 61a8d01f64b1f8a9811666d14caeef20324eeb76 Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Thu, 19 Jun 2025 13:47:04 +0200 Subject: [PATCH] ci: split docker amd64 & arm64 builds --- .github/workflows/docker.yml | 25 ++++++++++++++++++++++--- docker-compose.yml | 8 +++++--- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 55626376..4a97729c 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -4,9 +4,9 @@ on: branches: - main jobs: - docker: + docker-amd64: if: github.repository == 'OpenWF/SpaceNinjaServer' - runs-on: ubuntu-latest + runs-on: amd64 steps: - name: Set up Docker buildx uses: docker/setup-buildx-action@v3 @@ -18,8 +18,27 @@ jobs: - name: Build and push uses: docker/build-push-action@v6 with: - platforms: linux/amd64,linux/arm64 + platforms: linux/amd64 push: true tags: | openwf/spaceninjaserver:latest openwf/spaceninjaserver:${{ github.sha }} + docker-arm64: + if: github.repository == 'OpenWF/SpaceNinjaServer' + runs-on: arm64 + steps: + - name: Set up Docker buildx + uses: docker/setup-buildx-action@v3 + - name: Log in to container registry + uses: docker/login-action@v3 + with: + username: openwf + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v6 + with: + platforms: linux/arm64 + push: true + tags: | + openwf/spaceninjaserver:latest-arm64 + openwf/spaceninjaserver:${{ github.sha }}-arm64 diff --git a/docker-compose.yml b/docker-compose.yml index aa328756..d9f89348 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,8 @@ services: spaceninjaserver: + # The image to use. If you have an ARM CPU, replace 'latest' with 'latest-arm64'. + image: openwf/spaceninjaserver:latest + volumes: - ./docker-data/conf:/app/conf - ./docker-data/static-data:/app/static/data @@ -8,10 +11,9 @@ services: - 80:80 - 443:443 - # Normally, the image is fetched from Docker Hub, but you can use the local Dockerfile by swapping the following two fields. - # Works best when using `docker-compose up --force-recreate --build`. - image: openwf/spaceninjaserver:latest + # Normally, the image is fetched from Docker Hub, but you can use the local Dockerfile by removing "image" above and adding this: #build: . + # Works best when using `docker-compose up --force-recreate --build`. depends_on: - mongodb