From 3830dcb3f3e3b834d5cf50991726087189741084 Mon Sep 17 00:00:00 2001 From: Pavel Date: Tue, 4 Feb 2025 19:42:24 +0300 Subject: [PATCH 1/5] footer text with links --- docs/theme.config.jsx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/docs/theme.config.jsx b/docs/theme.config.jsx index 777a0ed5..77d8b9c1 100644 --- a/docs/theme.config.jsx +++ b/docs/theme.config.jsx @@ -49,7 +49,22 @@ const config = { light: 212, }, footer: { - text: `MIT ${new Date().getFullYear()} © DocsGPT`, + text: ( +
+ MIT {new Date().getFullYear()} © + + DocsGPT + + {' | '} + + GitHub + + {' | '} + + Blog + +
+ ), }, editLink: { content: 'Edit this page on GitHub', From a8891dabec02394eb811dcd1aa7e7497b7122f87 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 4 Feb 2025 17:46:44 +0000 Subject: [PATCH 2/5] feat: docker arm64 --- .github/workflows/docker-develop-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-develop-build.yml b/.github/workflows/docker-develop-build.yml index 5a22b1a1..736ac615 100644 --- a/.github/workflows/docker-develop-build.yml +++ b/.github/workflows/docker-develop-build.yml @@ -39,7 +39,7 @@ jobs: uses: docker/build-push-action@v6 with: file: './application/Dockerfile' - platforms: linux/amd64 + platforms: linux/amd64,linux/arm64 context: ./application push: true tags: | From b82c14892e5dc69d90aec4c0723d8e7b4fa87591 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 4 Feb 2025 21:02:44 +0000 Subject: [PATCH 3/5] Arm builds (#1615) * fix: matrix build * fix: trigger build * fix: trigger wrong name * fix: runner name * fix: manifest fix * fix: yaml error * fix: manifest build * fix: build error * feat: multi arch containers --- .github/workflows/ci.yml | 79 ++++++++++++++++-- .github/workflows/cife.yml | 80 +++++++++++++++++-- .github/workflows/docker-develop-build.yml | 79 +++++++++++++----- .github/workflows/docker-develop-fe-build.yml | 69 ++++++++++++++-- 4 files changed, 267 insertions(+), 40 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 090a69db..67ebe0dc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,20 +5,33 @@ on: types: [published] jobs: - deploy: + build: if: github.repository == 'arc53/DocsGPT' - runs-on: ubuntu-latest + strategy: + matrix: + include: + - platform: linux/amd64 + runner: ubuntu-latest + suffix: amd64 + - platform: linux/arm64 + runner: ubuntu-24.04-arm + suffix: arm64 + runs-on: ${{ matrix.runner }} permissions: contents: read packages: write steps: - uses: actions/checkout@v4 - - name: Set up QEMU + - name: Set up QEMU # Only needed for emulation, not for native arm64 builds + if: matrix.platform == 'linux/arm64' uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + with: + driver: docker-container + install: true - name: Login to DockerHub uses: docker/login-action@v3 @@ -33,15 +46,67 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push Docker images to docker.io and ghcr.io + - name: Build and push platform-specific images uses: docker/build-push-action@v6 with: file: './application/Dockerfile' - platforms: linux/amd64 + platforms: ${{ matrix.platform }} context: ./application push: true tags: | - ${{ secrets.DOCKER_USERNAME }}/docsgpt:${{ github.event.release.tag_name }},${{ secrets.DOCKER_USERNAME }}/docsgpt:latest - ghcr.io/${{ github.repository_owner }}/docsgpt:${{ github.event.release.tag_name }},ghcr.io/${{ github.repository_owner }}/docsgpt:latest + ${{ secrets.DOCKER_USERNAME }}/docsgpt:${{ github.event.release.tag_name }}-${{ matrix.suffix }} + ghcr.io/${{ github.repository_owner }}/docsgpt:${{ github.event.release.tag_name }}-${{ matrix.suffix }} + provenance: false + sbom: false cache-from: type=registry,ref=${{ secrets.DOCKER_USERNAME }}/docsgpt:latest cache-to: type=inline + + manifest: + if: github.repository == 'arc53/DocsGPT' + needs: build + runs-on: ubuntu-latest + permissions: + packages: write + steps: + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + driver: docker-container + install: true + + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to ghcr.io + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create and push manifest for DockerHub + run: | + set -e + docker manifest create ${{ secrets.DOCKER_USERNAME }}/docsgpt:${{ github.event.release.tag_name }} \ + --amend ${{ secrets.DOCKER_USERNAME }}/docsgpt:${{ github.event.release.tag_name }}-amd64 \ + --amend ${{ secrets.DOCKER_USERNAME }}/docsgpt:${{ github.event.release.tag_name }}-arm64 + docker manifest push ${{ secrets.DOCKER_USERNAME }}/docsgpt:${{ github.event.release.tag_name }} + docker manifest create ${{ secrets.DOCKER_USERNAME }}/docsgpt:latest \ + --amend ${{ secrets.DOCKER_USERNAME }}/docsgpt:${{ github.event.release.tag_name }}-amd64 \ + --amend ${{ secrets.DOCKER_USERNAME }}/docsgpt:${{ github.event.release.tag_name }}-arm64 + docker manifest push ${{ secrets.DOCKER_USERNAME }}/docsgpt:latest + + - name: Create and push manifest for ghcr.io + run: | + set -e + docker manifest create ghcr.io/${{ github.repository_owner }}/docsgpt:${{ github.event.release.tag_name }} \ + --amend ghcr.io/${{ github.repository_owner }}/docsgpt:${{ github.event.release.tag_name }}-amd64 \ + --amend ghcr.io/${{ github.repository_owner }}/docsgpt:${{ github.event.release.tag_name }}-arm64 + docker manifest push ghcr.io/${{ github.repository_owner }}/docsgpt:${{ github.event.release.tag_name }} + docker manifest create ghcr.io/${{ github.repository_owner }}/docsgpt:latest \ + --amend ghcr.io/${{ github.repository_owner }}/docsgpt:${{ github.event.release.tag_name }}-amd64 \ + --amend ghcr.io/${{ github.repository_owner }}/docsgpt:${{ github.event.release.tag_name }}-arm64 + docker manifest push ghcr.io/${{ github.repository_owner }}/docsgpt:latest \ No newline at end of file diff --git a/.github/workflows/cife.yml b/.github/workflows/cife.yml index 711cab29..1118723f 100644 --- a/.github/workflows/cife.yml +++ b/.github/workflows/cife.yml @@ -5,20 +5,33 @@ on: types: [published] jobs: - deploy: + build: if: github.repository == 'arc53/DocsGPT' - runs-on: ubuntu-latest + strategy: + matrix: + include: + - platform: linux/amd64 + runner: ubuntu-latest + suffix: amd64 + - platform: linux/arm64 + runner: ubuntu-24.04-arm + suffix: arm64 + runs-on: ${{ matrix.runner }} permissions: contents: read packages: write steps: - uses: actions/checkout@v4 - - name: Set up QEMU + - name: Set up QEMU # Only needed for emulation, not for native arm64 builds + if: matrix.platform == 'linux/arm64' uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + with: + driver: docker-container + install: true - name: Login to DockerHub uses: docker/login-action@v3 @@ -33,16 +46,67 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - # Runs a single command using the runners shell - - name: Build and push Docker images to docker.io and ghcr.io + - name: Build and push platform-specific images uses: docker/build-push-action@v6 with: file: './frontend/Dockerfile' - platforms: linux/amd64, linux/arm64 + platforms: ${{ matrix.platform }} context: ./frontend push: true tags: | - ${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:${{ github.event.release.tag_name }},${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:latest - ghcr.io/${{ github.repository_owner }}/docsgpt-fe:${{ github.event.release.tag_name }},ghcr.io/${{ github.repository_owner }}/docsgpt-fe:latest + ${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:${{ github.event.release.tag_name }}-${{ matrix.suffix }} + ghcr.io/${{ github.repository_owner }}/docsgpt-fe:${{ github.event.release.tag_name }}-${{ matrix.suffix }} + provenance: false + sbom: false cache-from: type=registry,ref=${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:latest cache-to: type=inline + + manifest: + if: github.repository == 'arc53/DocsGPT' + needs: build + runs-on: ubuntu-latest + permissions: + packages: write + steps: + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + driver: docker-container + install: true + + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to ghcr.io + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create and push manifest for DockerHub + run: | + set -e + docker manifest create ${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:${{ github.event.release.tag_name }} \ + --amend ${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:${{ github.event.release.tag_name }}-amd64 \ + --amend ${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:${{ github.event.release.tag_name }}-arm64 + docker manifest push ${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:${{ github.event.release.tag_name }} + docker manifest create ${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:latest \ + --amend ${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:${{ github.event.release.tag_name }}-amd64 \ + --amend ${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:${{ github.event.release.tag_name }}-arm64 + docker manifest push ${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:latest + + - name: Create and push manifest for ghcr.io + run: | + set -e + docker manifest create ghcr.io/${{ github.repository_owner }}/docsgpt-fe:${{ github.event.release.tag_name }} \ + --amend ghcr.io/${{ github.repository_owner }}/docsgpt-fe:${{ github.event.release.tag_name }}-amd64 \ + --amend ghcr.io/${{ github.repository_owner }}/docsgpt-fe:${{ github.event.release.tag_name }}-arm64 + docker manifest push ghcr.io/${{ github.repository_owner }}/docsgpt-fe:${{ github.event.release.tag_name }} + docker manifest create ghcr.io/${{ github.repository_owner }}/docsgpt-fe:latest \ + --amend ghcr.io/${{ github.repository_owner }}/docsgpt-fe:${{ github.event.release.tag_name }}-amd64 \ + --amend ghcr.io/${{ github.repository_owner }}/docsgpt-fe:${{ github.event.release.tag_name }}-arm64 + docker manifest push ghcr.io/${{ github.repository_owner }}/docsgpt-fe:latest \ No newline at end of file diff --git a/.github/workflows/docker-develop-build.yml b/.github/workflows/docker-develop-build.yml index 736ac615..b0045934 100644 --- a/.github/workflows/docker-develop-build.yml +++ b/.github/workflows/docker-develop-build.yml @@ -1,4 +1,4 @@ -name: Build and push DocsGPT Docker image for development +name: Build and push multi-arch DocsGPT Docker image on: workflow_dispatch: @@ -7,20 +7,29 @@ on: - main jobs: - deploy: + build: if: github.repository == 'arc53/DocsGPT' - runs-on: ubuntu-latest + strategy: + matrix: + include: + - platform: linux/amd64 + runner: ubuntu-latest + suffix: amd64 + - platform: linux/arm64 + runner: ubuntu-24.04-arm + suffix: arm64 + runs-on: ${{ matrix.runner }} permissions: contents: read packages: write steps: - uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + with: + driver: docker-container + install: true - name: Login to DockerHub uses: docker/login-action@v3 @@ -28,22 +37,56 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} + - name: Build and push platform-specific images + uses: docker/build-push-action@v6 + with: + file: './application/Dockerfile' + platforms: ${{ matrix.platform }} + context: ./application + push: true + tags: | + ${{ secrets.DOCKER_USERNAME }}/docsgpt:develop-${{ matrix.suffix }} + provenance: false + sbom: false + cache-from: type=registry,ref=${{ secrets.DOCKER_USERNAME }}/docsgpt:develop + cache-to: type=inline + + manifest: + if: github.repository == 'arc53/DocsGPT' + needs: build + runs-on: ubuntu-latest + permissions: + packages: write + steps: + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + driver: docker-container + install: true + + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Login to ghcr.io uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create and push manifest for DockerHub + run: | + docker manifest create ${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:develop \ + --amend ${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:develop-amd64 \ + --amend ${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:develop-arm64 + docker manifest push ${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:develop - - name: Build and push Docker images to docker.io and ghcr.io - uses: docker/build-push-action@v6 - with: - file: './application/Dockerfile' - platforms: linux/amd64,linux/arm64 - context: ./application - push: true - tags: | - ${{ secrets.DOCKER_USERNAME }}/docsgpt:develop - ghcr.io/${{ github.repository_owner }}/docsgpt:develop - cache-from: type=registry,ref=${{ secrets.DOCKER_USERNAME }}/docsgpt:develop - cache-to: type=inline + - name: Create and push manifest for ghcr.io + run: | + docker manifest create ghcr.io/${{ github.repository_owner }}/docsgpt-fe:develop \ + --amend ghcr.io/${{ github.repository_owner }}/docsgpt-fe:develop-amd64 \ + --amend ghcr.io/${{ github.repository_owner }}/docsgpt-fe:develop-arm64 + docker manifest push ghcr.io/${{ github.repository_owner }}/docsgpt-fe:develop \ No newline at end of file diff --git a/.github/workflows/docker-develop-fe-build.yml b/.github/workflows/docker-develop-fe-build.yml index 317635bd..df7bdac6 100644 --- a/.github/workflows/docker-develop-fe-build.yml +++ b/.github/workflows/docker-develop-fe-build.yml @@ -7,20 +7,33 @@ on: - main jobs: - deploy: + build: if: github.repository == 'arc53/DocsGPT' - runs-on: ubuntu-latest + strategy: + matrix: + include: + - platform: linux/amd64 + runner: ubuntu-latest + suffix: amd64 + - platform: linux/arm64 + runner: ubuntu-24.04-arm + suffix: arm64 + runs-on: ${{ matrix.runner }} permissions: contents: read packages: write steps: - uses: actions/checkout@v4 - - name: Set up QEMU + - name: Set up QEMU # Only needed for emulation, not for native arm64 builds + if: matrix.platform == 'linux/arm64' uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + with: + driver: docker-container + install: true - name: Login to DockerHub uses: docker/login-action@v3 @@ -35,15 +48,57 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push Docker images to docker.io and ghcr.io + - name: Build and push platform-specific images uses: docker/build-push-action@v6 with: file: './frontend/Dockerfile' - platforms: linux/amd64 + platforms: ${{ matrix.platform }} context: ./frontend push: true tags: | - ${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:develop - ghcr.io/${{ github.repository_owner }}/docsgpt-fe:develop + ${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:develop-${{ matrix.suffix }} + ghcr.io/${{ github.repository_owner }}/docsgpt-fe:develop-${{ matrix.suffix }} + provenance: false + sbom: false cache-from: type=registry,ref=${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:develop cache-to: type=inline + + manifest: + if: github.repository == 'arc53/DocsGPT' + needs: build + runs-on: ubuntu-latest + permissions: + packages: write + steps: + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + driver: docker-container + install: true + + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to ghcr.io + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create and push manifest for DockerHub + run: | + docker manifest create ${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:develop \ + --amend ${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:develop-amd64 \ + --amend ${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:develop-arm64 + docker manifest push ${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:develop + + - name: Create and push manifest for ghcr.io + run: | + docker manifest create ghcr.io/${{ github.repository_owner }}/docsgpt-fe:develop \ + --amend ghcr.io/${{ github.repository_owner }}/docsgpt-fe:develop-amd64 \ + --amend ghcr.io/${{ github.repository_owner }}/docsgpt-fe:develop-arm64 + docker manifest push ghcr.io/${{ github.repository_owner }}/docsgpt-fe:develop \ No newline at end of file From 797b36a81eb487478536f74031a8557c4b1d3c67 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 4 Feb 2025 21:56:26 +0000 Subject: [PATCH 4/5] fix: container name --- .github/workflows/docker-develop-build.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docker-develop-build.yml b/.github/workflows/docker-develop-build.yml index b0045934..e5c16afc 100644 --- a/.github/workflows/docker-develop-build.yml +++ b/.github/workflows/docker-develop-build.yml @@ -79,14 +79,14 @@ jobs: - name: Create and push manifest for DockerHub run: | - docker manifest create ${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:develop \ - --amend ${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:develop-amd64 \ - --amend ${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:develop-arm64 - docker manifest push ${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:develop + docker manifest create ${{ secrets.DOCKER_USERNAME }}/docsgpt:develop \ + --amend ${{ secrets.DOCKER_USERNAME }}/docsgpt:develop-amd64 \ + --amend ${{ secrets.DOCKER_USERNAME }}/docsgpt:develop-arm64 + docker manifest push ${{ secrets.DOCKER_USERNAME }}/docsgpt:develop - name: Create and push manifest for ghcr.io run: | - docker manifest create ghcr.io/${{ github.repository_owner }}/docsgpt-fe:develop \ - --amend ghcr.io/${{ github.repository_owner }}/docsgpt-fe:develop-amd64 \ - --amend ghcr.io/${{ github.repository_owner }}/docsgpt-fe:develop-arm64 - docker manifest push ghcr.io/${{ github.repository_owner }}/docsgpt-fe:develop \ No newline at end of file + docker manifest create ghcr.io/${{ github.repository_owner }}/docsgpt:develop \ + --amend ghcr.io/${{ github.repository_owner }}/docsgpt:develop-amd64 \ + --amend ghcr.io/${{ github.repository_owner }}/docsgpt:develop-arm64 + docker manifest push ghcr.io/${{ github.repository_owner }}/docsgpt:develop \ No newline at end of file From 73ba078efcfa5b3cd20aaf4b851597f8c38b668c Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 4 Feb 2025 22:02:56 +0000 Subject: [PATCH 5/5] fix: init push to ghcr --- .github/workflows/docker-develop-build.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/docker-develop-build.yml b/.github/workflows/docker-develop-build.yml index e5c16afc..44a61769 100644 --- a/.github/workflows/docker-develop-build.yml +++ b/.github/workflows/docker-develop-build.yml @@ -36,6 +36,13 @@ jobs: with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to ghcr.io + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push platform-specific images uses: docker/build-push-action@v6 @@ -46,6 +53,7 @@ jobs: push: true tags: | ${{ secrets.DOCKER_USERNAME }}/docsgpt:develop-${{ matrix.suffix }} + ghcr.io/${{ github.repository_owner }}/docsgpt:develop-${{ matrix.suffix }} provenance: false sbom: false cache-from: type=registry,ref=${{ secrets.DOCKER_USERNAME }}/docsgpt:develop