|
7 | 7 | env: |
8 | 8 | CARGO_TERM_COLOR: always |
9 | 9 | CARGO_INCREMENTAL: 0 |
| 10 | + IMAGE: ghcr.io/context-graph-ai/contextdb-server |
10 | 11 |
|
11 | 12 | permissions: |
12 | 13 | contents: write |
@@ -42,29 +43,67 @@ jobs: |
42 | 43 | sleep 30 |
43 | 44 | done |
44 | 45 |
|
45 | | - publish-docker: |
| 46 | + build-docker: |
46 | 47 | needs: verify-version |
47 | | - runs-on: ubuntu-latest |
| 48 | + strategy: |
| 49 | + matrix: |
| 50 | + include: |
| 51 | + - platform: linux/amd64 |
| 52 | + runner: ubuntu-latest |
| 53 | + - platform: linux/arm64 |
| 54 | + runner: ubuntu-24.04-arm |
| 55 | + runs-on: ${{ matrix.runner }} |
48 | 56 | steps: |
49 | 57 | - uses: actions/checkout@v4 |
50 | | - - uses: docker/setup-qemu-action@v3 |
51 | 58 | - uses: docker/setup-buildx-action@v3 |
52 | 59 | - uses: docker/login-action@v3 |
53 | 60 | with: |
54 | 61 | registry: ghcr.io |
55 | 62 | username: ${{ github.actor }} |
56 | 63 | password: ${{ secrets.GITHUB_TOKEN }} |
57 | | - - name: Build and push multi-arch image |
| 64 | + - name: Build and push digest |
| 65 | + id: build |
58 | 66 | uses: docker/build-push-action@v6 |
59 | 67 | with: |
60 | 68 | context: . |
61 | | - platforms: linux/amd64,linux/arm64 |
| 69 | + platforms: ${{ matrix.platform }} |
62 | 70 | push: true |
63 | | - tags: | |
64 | | - ghcr.io/context-graph-ai/contextdb-server:${{ github.ref_name }} |
65 | | - ghcr.io/context-graph-ai/contextdb-server:latest |
66 | | - cache-from: type=gha |
67 | | - cache-to: type=gha,mode=max |
| 71 | + tags: ${{ env.IMAGE }} |
| 72 | + cache-from: type=gha,scope=${{ matrix.platform }} |
| 73 | + cache-to: type=gha,scope=${{ matrix.platform }},mode=max |
| 74 | + outputs: type=image,push-by-digest=true,name-canonical=true |
| 75 | + - name: Export digest |
| 76 | + run: | |
| 77 | + mkdir -p /tmp/digests |
| 78 | + digest="${{ steps.build.outputs.digest }}" |
| 79 | + touch "/tmp/digests/${digest#sha256:}" |
| 80 | + - uses: actions/upload-artifact@v4 |
| 81 | + with: |
| 82 | + name: docker-digest-${{ strategy.job-index }} |
| 83 | + path: /tmp/digests/* |
| 84 | + |
| 85 | + publish-docker: |
| 86 | + needs: build-docker |
| 87 | + runs-on: ubuntu-latest |
| 88 | + steps: |
| 89 | + - uses: docker/setup-buildx-action@v3 |
| 90 | + - uses: docker/login-action@v3 |
| 91 | + with: |
| 92 | + registry: ghcr.io |
| 93 | + username: ${{ github.actor }} |
| 94 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 95 | + - uses: actions/download-artifact@v4 |
| 96 | + with: |
| 97 | + path: /tmp/digests |
| 98 | + pattern: docker-digest-* |
| 99 | + merge-multiple: true |
| 100 | + - name: Create manifest and push |
| 101 | + run: | |
| 102 | + cd /tmp/digests |
| 103 | + docker buildx imagetools create \ |
| 104 | + -t $IMAGE:${{ github.ref_name }} \ |
| 105 | + -t $IMAGE:latest \ |
| 106 | + $(printf '$IMAGE@sha256:%s ' *) |
68 | 107 |
|
69 | 108 | build-binaries: |
70 | 109 | needs: verify-version |
@@ -139,7 +178,7 @@ jobs: |
139 | 178 | - uses: actions/checkout@v4 |
140 | 179 | - uses: actions-rust-lang/setup-rust-toolchain@v1 |
141 | 180 | - name: Install mdBook |
142 | | - run: cargo install mdbook |
| 181 | + run: cargo install mdbook --version 0.5.2 |
143 | 182 | - name: Build docs |
144 | 183 | run: mdbook build |
145 | 184 | - name: Dispatch to website repo |
|
0 commit comments