Skip to content

Commit 8ff70d7

Browse files
authored
ci: speed up dev image deploy (gha cache, amd64-only) (#1787)
- Publish dev image as linux/amd64 only to reduce CI time\n- Enable Buildx GHA cache for faster repeat builds\n- Drop QEMU step (no multi-arch in CI)\n- Always run ECR Public push steps (remove secrets-based conditionals)\n- Docs: clarify CI publishes amd64 only; arm64 build locally via buildx\n- Docker ignore: include Cargo.lock; ignore .git/.github to reduce context Signed-off-by: jerry609 <1772030600@qq.com>
1 parent dfc3757 commit 8ff70d7

3 files changed

Lines changed: 17 additions & 9 deletions

File tree

.dockerignore

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
# Generated by Cargo
22
# will have compiled files and executables
33
**/target/
4-
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
5-
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
6-
Cargo.lock
4+
# Keep Cargo.lock in build context for reproducible + cache-friendly builds.
75

86
# These are backup files generated by rustfmt
97
**/*.rs.bk
@@ -33,3 +31,7 @@ buck-out
3331
docker/mono-engine-dockerfile
3432
docker/mono-pg-dockerfile
3533
docker/aries-engine-dockerfile
34+
35+
# git / ci metadata (not needed for docker builds, reduces build context)
36+
.git/
37+
.github/

.github/workflows/mega-dev-image-deploy.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: Mega Dev Image deploy
22
on:
3+
workflow_dispatch:
34
push:
45
branches:
56
- main
@@ -17,6 +18,10 @@ concurrency:
1718
group: ${{ github.workflow }}-${{ github.ref }}
1819
cancel-in-progress: true
1920

21+
permissions:
22+
contents: read
23+
actions: write
24+
2025
jobs:
2126
build-and-push:
2227
runs-on: ubuntu-latest
@@ -25,9 +30,6 @@ jobs:
2530
- name: Checkout repository
2631
uses: actions/checkout@v4
2732

28-
- name: Set up QEMU
29-
uses: docker/setup-qemu-action@v3
30-
3133
- name: Set up Docker Buildx
3234
uses: docker/setup-buildx-action@v3
3335

@@ -57,8 +59,10 @@ jobs:
5759
IMAGE_BASE="$REGISTRY/$REGISTRY_ALIAS/$REPOSITORY"
5860
5961
docker buildx build \
60-
--platform linux/amd64,linux/arm64 \
62+
--platform linux/amd64 \
6163
--target runtime \
64+
--cache-from type=gha,scope=mega-dev-image \
65+
--cache-to type=gha,mode=max,scope=mega-dev-image \
6266
-t "$IMAGE_BASE:$IMAGE_TAG" \
6367
-t "$IMAGE_BASE:$IMAGE_TAG-$TIMESTAMP" \
6468
-f docker/dev-image/Dockerfile \

docker/dev-image/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ This image intentionally does **not** start Orion Server or PostgreSQL. It is de
3838

3939
### Supported Architectures
4040

41-
- `linux/amd64` (x86_64)
42-
- `linux/arm64` (aarch64)
41+
- `linux/amd64` (x86_64) — published by CI
42+
- `linux/arm64` (aarch64) — supported by the Dockerfile; build locally with Buildx
4343

4444
---
4545

@@ -126,6 +126,8 @@ docker logs -f orion-worker
126126

127127
### Multi-Architecture Build
128128

129+
Note: CI currently publishes `linux/amd64` only. The multi-arch command below is for local testing and/or pushing to your own registry.
130+
129131
```bash
130132
docker buildx create --name mega-builder --use
131133

0 commit comments

Comments
 (0)