From edbe4786d52ca23a5285470bd16ca04739dae10c Mon Sep 17 00:00:00 2001 From: Tom Rogers Date: Thu, 30 Jan 2025 17:22:41 +0100 Subject: [PATCH] Add Multi-arch builds to the GCHR, and fix typo in the docker compose file for mail server (#4528) * Add Multi-arch builds to include linux/arm64 * Fix template parameter for git sha * Fix Typo with local-mail server * Copy the project files * Change context for image-proxy * Improve runner --- .github/workflows/build-docker-images.yml | 2 +- .../build-self-host-docker-images.yml | 108 ++++++++++++------ .../docker-compose/docker-compose.yml | 2 +- 3 files changed, 73 insertions(+), 39 deletions(-) diff --git a/.github/workflows/build-docker-images.yml b/.github/workflows/build-docker-images.yml index 1a1614ea5..d2de4d6d8 100644 --- a/.github/workflows/build-docker-images.yml +++ b/.github/workflows/build-docker-images.yml @@ -10,7 +10,7 @@ on: jobs: build-docker-images: name: Build docker images - runs-on: ubuntu-latest + runs-on: 'ubuntu-latest-m' steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/build-self-host-docker-images.yml b/.github/workflows/build-self-host-docker-images.yml index 95d6f4581..0b4335151 100644 --- a/.github/workflows/build-self-host-docker-images.yml +++ b/.github/workflows/build-self-host-docker-images.yml @@ -3,10 +3,10 @@ on: push: branches: - main - - self-host-updates paths-ignore: - 'apple/**' - 'android/**' + - 'self-hosting/**' jobs: build-self-hostdocker-images: @@ -19,46 +19,80 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: 'Login to GitHub container registry' - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{github.actor}} password: ${{secrets.GITHUB_TOKEN}} - - name: Build the backend docker image - run: | - docker build . --file packages/api/Dockerfile --tag "ghcr.io/omnivore-app/sh-backend:${GITHUB_SHA}" --tag ghcr.io/omnivore-app/sh-backend:latest - docker push ghcr.io/omnivore-app/sh-backend:${GITHUB_SHA} - docker push ghcr.io/omnivore-app/sh-backend:latest - - name: Build the content-fetch docker image - run: | - docker build --file packages/content-fetch/Dockerfile . --tag "ghcr.io/omnivore-app/sh-content-fetch:${GITHUB_SHA}" --tag ghcr.io/omnivore-app/sh-content-fetch:latest - docker push ghcr.io/omnivore-app/sh-content-fetch:${GITHUB_SHA} - docker push ghcr.io/omnivore-app/sh-content-fetch:latest - - name: Build the queue-processor docker image. - run: | - docker build . --file packages/api/queue-processor/Dockerfile --tag "ghcr.io/omnivore-app/sh-queue-processor:${GITHUB_SHA}" --tag ghcr.io/omnivore-app/sh-queue-processor:latest - docker push ghcr.io/omnivore-app/sh-queue-processor:${GITHUB_SHA} - docker push ghcr.io/omnivore-app/sh-queue-processor:latest - - name: Build the migrate docker image - run: | - docker build --file packages/db/Dockerfile . --tag "ghcr.io/omnivore-app/sh-migrate:${GITHUB_SHA}" --tag ghcr.io/omnivore-app/sh-migrate:latest - docker push ghcr.io/omnivore-app/sh-migrate:${GITHUB_SHA} - docker push ghcr.io/omnivore-app/sh-migrate:latest - - name: Build the image-proxy docker image - run: | - cp imageproxy/start_imageproxy.sh . - chmod +x start_imageproxy.sh - docker build --file imageproxy/Dockerfile . --tag "ghcr.io/omnivore-app/sh-image-proxy:${GITHUB_SHA}" --tag ghcr.io/omnivore-app/sh-image-proxy:latest - docker push ghcr.io/omnivore-app/sh-image-proxy:${GITHUB_SHA} - docker push ghcr.io/omnivore-app/sh-image-proxy:latest - - name: Build the mail-watch-server docker image - run: | - docker build --file packages/local-mail-watcher/Dockerfile . --tag "ghcr.io/omnivore-app/sh-local-mail-watcher:${GITHUB_SHA}" --tag ghcr.io/omnivore-app/sh-local-mail-watcher:latest - docker push ghcr.io/omnivore-app/sh-local-mail-watcher:${GITHUB_SHA} - docker push ghcr.io/omnivore-app/sh-local-mail-watcher:latest - - + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and push backend + uses: docker/build-push-action@v6 + with: + platforms: linux/amd64,linux/arm64 + push: true + tags: ghcr.io/omnivore-app/sh-backend:latest,ghcr.io/omnivore-app/sh-backend:${{ github.sha }} + file: packages/api/Dockerfile + cache-from: type=registry,ref=ghcr.io/omnivore-app/sh-backend:latest + cache-to: type=registry,ref=ghcr.io/omnivore-app/sh-backend:latest,mode=max + + - name: Build and push queue-processor + uses: docker/build-push-action@v6 + with: + platforms: linux/amd64,linux/arm64 + push: true + tags: ghcr.io/omnivore-app/sh-queue-processor:latest,ghcr.io/omnivore-app/sh-queue-processor:${{ github.sha }} + file: packages/api/queue-processor/Dockerfile + cache-from: type=registry,ref=ghcr.io/omnivore-app/queue-processor:latest + cache-to: type=registry,ref=ghcr.io/omnivore-app/queue-processor:latest,mode=max + + - name: Build and push image-proxy + uses: docker/build-push-action@v6 + with: + platforms: linux/amd64,linux/arm64 + push: true + tags: ghcr.io/omnivore-app/sh-image-proxy:latest,ghcr.io/omnivore-app/sh-image-proxy:${{ github.sha }} + context: imageproxy/ + file: imageproxy/Dockerfile + cache-from: type=registry,ref=ghcr.io/omnivore-app/sh-image-proxy:latest + cache-to: type=registry,ref=ghcr.io/omnivore-app/sh-image-proxy:latest,mode=max + + - name: Build and push content-fetch + uses: docker/build-push-action@v6 + with: + platforms: linux/amd64,linux/arm64 + push: true + tags: ghcr.io/omnivore-app/sh-content-fetch:latest,ghcr.io/omnivore-app/sh-content-fetch:${{ github.sha }} + file: packages/content-fetch/Dockerfile + cache-from: type=registry,ref=ghcr.io/omnivore-app/sh-content-fetch:latest + cache-to: type=registry,ref=ghcr.io/omnivore-app/sh-content-fetch:latest,mode=max + + - name: Build and push migrate + uses: docker/build-push-action@v6 + with: + platforms: linux/amd64,linux/arm64 + push: true + tags: ghcr.io/omnivore-app/sh-migrate:latest,ghcr.io/omnivore-app/sh-migrate:${{ github.sha }} + file: packages/db/Dockerfile + cache-from: type=registry,ref=ghcr.io/omnivore-app/sh-migrate:latest + cache-to: type=registry,ref=ghcr.io/omnivore-app/sh-migrate:latest,mode=max + + - name: Build and push local-mail-watcher + uses: docker/build-push-action@v6 + with: + platforms: linux/amd64,linux/arm64 + push: true + tags: ghcr.io/omnivore-app/sh-local-mail-watcher:latest,ghcr.io/omnivore-app/sh-local-mail-watcher:${{ github.sha }} + file: packages/local-mail-watcher/Dockerfile + cache-from: type=registry,ref=ghcr.io/omnivore-app/sh-local-mail-watcher:latest + cache-to: type=registry,ref=ghcr.io/omnivore-app/sh-local-mail-watcher:latest,mode=max + + diff --git a/self-hosting/docker-compose/docker-compose.yml b/self-hosting/docker-compose/docker-compose.yml index e61f9bc1e..ee253aa21 100644 --- a/self-hosting/docker-compose/docker-compose.yml +++ b/self-hosting/docker-compose/docker-compose.yml @@ -144,7 +144,7 @@ services: exit 0; " mail-watch-server: - image: "ghcr.io/omnivore-app/sh-image-proxy:latest" + image: "ghcr.io/omnivore-app/sh-local-mail-watcher:latest" container_name: "omnivore-mail-watch-server" ports: - "4398:8080"