Skip to content
This repository was archived by the owner on Oct 19, 2026. It is now read-only.

Commit 0c7ec7f

Browse files
authored
feat: update deploy action (#2007)
1 parent d4639d8 commit 0c7ec7f

18 files changed

Lines changed: 181 additions & 97 deletions

‎.github/workflows/mono-engine-deploy.yml‎

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@ on:
1818

1919
env:
2020
REGISTRY_ALIAS: m8q5m4u3
21-
REPOSITORY: mega
21+
REPOSITORY: mega/mono-engine
2222
GCP_PROJECT_ID: infra-20250121-20260121-0235
23-
GCP_REPOSITORY: mega
24-
IMAGE_TAG_BASE: mono-0.1.0-pre-release
23+
IMAGE_TAG_BASE: latest
2524

2625
# Using AWS access key for authentication
2726
permissions:
@@ -36,9 +35,6 @@ jobs:
3635
build-push-single-arch:
3736
runs-on: ubuntu-latest
3837
timeout-minutes: 30
39-
permissions:
40-
id-token: write
41-
contents: read
4238

4339
steps:
4440
- uses: actions/checkout@v4
@@ -88,12 +84,14 @@ jobs:
8884
IMAGE_TAG="${IMAGE_TAG_BASE}-${ARCH_SUFFIX}"
8985
9086
ECR_IMAGE="$ECR_REGISTRY/${{ env.REGISTRY_ALIAS }}/${{ env.REPOSITORY }}:$IMAGE_TAG"
91-
GCP_IMAGE="us-central1-docker.pkg.dev/${{ env.GCP_PROJECT_ID }}/${{ env.GCP_REPOSITORY }}/${{ env.REPOSITORY }}:$IMAGE_TAG"
87+
GCP_IMAGE="us-central1-docker.pkg.dev/${{ env.GCP_PROJECT_ID }}/${{ env.REPOSITORY }}:$IMAGE_TAG"
9288
9389
echo "ECR_IMAGE=$ECR_IMAGE"
9490
echo "GCP_IMAGE=$GCP_IMAGE"
9591
9692
docker buildx build \
93+
--cache-from type=gha \
94+
--cache-to type=gha,mode=max \
9795
--provenance=false \
9896
--sbom=false \
9997
-f ./mono/Dockerfile \
@@ -157,7 +155,7 @@ jobs:
157155

158156
deploy-gcp:
159157
needs: manifest
160-
# if: ${{ github.repository == 'web3infra-foundation/mega' }}
158+
if: ${{ github.repository == 'web3infra-foundation/mega' }}
161159
runs-on: ubuntu-latest
162160
steps:
163161
- name: Auth to GCP
@@ -183,4 +181,4 @@ jobs:
183181
--image "$IMAGE" \
184182
--region "$REGION" \
185183
--project "$GCP_PROJECT_ID" \
186-
--quiet
184+
--quiet

‎.github/workflows/orion-server-deploy.yml‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@ on:
99

1010
env:
1111
REGISTRY_ALIAS: m8q5m4u3
12-
REPOSITORY: mega
13-
IMAGE_TAG_BASE: orion-server-0.1.0-pre-release
12+
REPOSITORY: mega/orion-server
13+
IMAGE_TAG_BASE: latest
1414
GCP_PROJECT_ID: infra-20250121-20260121-0235
15-
GCP_REPOSITORY: mega
1615

1716
permissions:
1817
id-token: write
@@ -33,7 +32,6 @@ jobs:
3332
steps:
3433
- name: Checkout
3534
uses: actions/checkout@v4
36-
3735
- name: Set up Docker Buildx
3836
uses: docker/setup-buildx-action@v3
3937

@@ -78,12 +76,14 @@ jobs:
7876
ARCH_SUFFIX="amd64"
7977
8078
AWS_IMAGE_BASE="$AWS_REGISTRY/${{ env.REGISTRY_ALIAS }}/${{ env.REPOSITORY }}"
81-
GCP_IMAGE_BASE="us-central1-docker.pkg.dev/${{ env.GCP_PROJECT_ID }}/${{ env.GCP_REPOSITORY }}/${{ env.REPOSITORY }}"
79+
GCP_IMAGE_BASE="us-central1-docker.pkg.dev/${{ env.GCP_PROJECT_ID }}/${{ env.REPOSITORY }}"
8280
8381
TAG="${{ env.IMAGE_TAG_BASE }}-$ARCH_SUFFIX"
8482
8583
docker buildx build \
8684
--platform "$PLATFORM" \
85+
--cache-from type=gha \
86+
--cache-to type=gha,mode=max \
8787
--provenance=false \
8888
--sbom=false \
8989
-f orion-server/Dockerfile \
@@ -147,7 +147,7 @@ jobs:
147147

148148
deploy-gcp:
149149
needs: manifest
150-
# if: ${{ github.repository == 'web3infra-foundation/mega' }}
150+
if: ${{ github.repository == 'web3infra-foundation/mega' }}
151151
runs-on: ubuntu-latest
152152
steps:
153153
- name: Auth to GCP

‎.github/workflows/web-deploy.yml‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ on:
1111
env:
1212
TIPTAP_PRIVATE_REGISTRY_KEY: ${{ secrets.TIPTAP_PRIVATE_REGISTRY_KEY }}
1313
REGISTRY_ALIAS: m8q5m4u3
14-
REPOSITORY: mega
14+
REPOSITORY: mega/mega-ui
1515
GCP_PROJECT_ID: infra-20250121-20260121-0235
16-
GCP_REPOSITORY: mega
17-
IMAGE_VERSION: 0.1.0-pre-release
16+
IMAGE_VERSION: latest
1817

1918
permissions:
2019
id-token: write
@@ -83,10 +82,10 @@ jobs:
8382
run: |
8483
set -euo pipefail
8584
ARCH_SUFFIX="amd64"
86-
IMAGE_TAG="mega-ui-${{ matrix.env_name }}-${IMAGE_VERSION}-${ARCH_SUFFIX}"
85+
IMAGE_TAG="${{ matrix.env_name }}-${IMAGE_VERSION}-${ARCH_SUFFIX}"
8786
8887
if [ "${{ matrix.env_name }}" = "buck2hub" ]; then
89-
IMAGE_BASE="us-central1-docker.pkg.dev/${{ env.GCP_PROJECT_ID }}/${{ env.GCP_REPOSITORY }}/${{ env.REPOSITORY }}"
88+
IMAGE_BASE="us-central1-docker.pkg.dev/${{ env.GCP_PROJECT_ID }}/${{ env.REPOSITORY }}"
9089
else
9190
IMAGE_BASE="$REGISTRY/${{ env.REGISTRY_ALIAS }}/${{ env.REPOSITORY }}"
9291
fi
@@ -107,7 +106,7 @@ jobs:
107106
runs-on: ubuntu-latest
108107
strategy:
109108
matrix:
110-
env_name: [demo, staging, gitmono, buck2hub]
109+
env_name: [demo, staging, gitmono]
111110
permissions:
112111
contents: read
113112
steps:
@@ -131,7 +130,7 @@ jobs:
131130
set -euo pipefail
132131
133132
IMAGE_BASE="$REGISTRY/${{ env.REGISTRY_ALIAS }}/${{ env.REPOSITORY }}"
134-
TAG="mega-ui-${{ matrix.env_name }}-0.1.0-pre-release"
133+
TAG="${{ matrix.env_name }}-latest"
135134
136135
if [ "${{ matrix.env_name }}" = "demo" ]; then
137136
echo "Creating multi-arch manifest for demo (amd64 + arm64)"

‎.github/workflows/web-sync-server-deploy.yml‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,18 @@ on:
1010
- 'moon/packages/config/**'
1111
- 'moon/packages/types/**'
1212

13-
env:
14-
TIPTAP_PRIVATE_REGISTRY_KEY: ${{ secrets.TIPTAP_PRIVATE_REGISTRY_KEY }}
15-
AWS_ECS_CLUSTER_NAME: ${{ secrets.AWS_ECS_CLUSTER_NAME }}
1613

1714
concurrency:
1815
group: ${{ github.workflow }}-${{ github.ref }}
1916
cancel-in-progress: true
2017

2118
jobs:
2219
web-sync-server-deploy:
23-
if: ${{ github.repository == 'web3infra-foundation/mega' }}
2420
runs-on: ubuntu-latest
2521
timeout-minutes: 10
2622
steps:
2723
- name: Checkout repository
2824
uses: actions/checkout@v4
29-
with:
30-
ref: ${{ github.event.pull_request.base.ref }}
3125

3226
- uses: actions/setup-node@v4
3327
with:
@@ -51,8 +45,8 @@ jobs:
5145
env:
5246
REGISTRY: ${{ steps.login-ecr-public.outputs.registry }}
5347
REGISTRY_ALIAS: m8q5m4u3
54-
REPOSITORY: mega
55-
IMAGE_TAG: mega-web-sync-server-0.1.0-pre-release
48+
REPOSITORY: mega/web-sync-server
49+
IMAGE_TAG: latest
5650
run: |
5751
docker build \
5852
-f apps/sync-server/Dockerfile \
@@ -62,7 +56,7 @@ jobs:
6256
- name: Force ECS redeploy
6357
run: |
6458
aws ecs update-service \
65-
--cluster ${{ secrets.AWS_ECS_CLUSTER_NAME }} \
59+
--cluster gitmega-com \
6660
--service mega-web-sync-server-dev-service-v3hdlyk8 \
6761
--force-new-deployment
6862
env:

‎.gitignore‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ ztm_agent.db
3030
ztm_agent_db*
3131

3232
# Demo env variables
33-
docker/demo/.env
33+
docker/**/.env
3434

3535
# buck2 out
3636
buck-out

‎Cargo.toml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ dagrs = "0.6.0"
132132
tar = "0.4"
133133
indexmap = "2.13"
134134
envsubst = "0.2.1"
135-
diffs = "0.5.1"
136135
directories = "6.0.0"
137136
dotenv = "0.15"
138137
redis = "1.0.3"

‎docker/README.md‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,9 @@ The main configurable environment variables include:
8989
- `MYSQL_DATABASE`: Campsite database name (default: `campsite`, uses MySQL)
9090

9191
- **Service Images**:
92-
- `MEGA_ENGINE_IMAGE`: Mega backend image (default: `public.ecr.aws/m8q5m4u3/mega:mono-0.1.0-pre-release`)
93-
- `MEGA_UI_IMAGE`: Mega UI image (default: `public.ecr.aws/m8q5m4u3/mega:mega-ui-demo-0.1.0-pre-release`)
94-
- `ORION_CLIENT_IMAGE`: Orion Build Client image (default: `public.ecr.aws/m8q5m4u3/mega:orion-client-0.1.0-pre-release`)
95-
- `CAMPSITE_API_IMAGE`: Campsite API image (default: `public.ecr.aws/m8q5m4u3/mega:campsite-0.1.0-pre-release`)
92+
- `MEGA_ENGINE_IMAGE`: Mega backend image (default: `public.ecr.aws/m8q5m4u3/mega/mono-engine:latest`)
93+
- `MEGA_UI_IMAGE`: Mega UI image (default: `public.ecr.aws/m8q5m4u3/mega/mega-ui:demo-latest`)
94+
- `CAMPSITE_API_IMAGE`: Campsite API image (default: `public.ecr.aws/m8q5m4u3/mega/campsite-api:latest`)
9695
- `CAMPSITE_RUN_MIGRATIONS`: Whether to run database migrations when the container starts; `1` (default) to run, can be changed to `0` after the first successful migration to skip and speed up subsequent starts.
9796

9897
- **RustFS Configuration**:
@@ -530,7 +529,7 @@ The demo environment includes the following services:
530529
- `mega_ui`: Mega Web UI (Next.js)
531530
- `orion_server`: Orion build server (Rust)
532531
- `orion_build_client`: Orion build client (based on the orion-client image)
533-
- `campsite_api`: Campsite API (Ruby/Rails, built locally by default; if you have the encrypted development credentials configured you can pull the pre-built image directly via `CAMPSITE_API_IMAGE=public.ecr.aws/m8q5m4u3/mega:campsite-0.1.0-pre-release`)
532+
- `campsite_api`: Campsite API (Ruby/Rails, built locally by default; if you have the encrypted development credentials configured you can pull the pre-built image directly via `CAMPSITE_API_IMAGE=public.ecr.aws/m8q5m4u3/mega/campsite-api:latest`)
534533

535534
For a detailed architecture diagram and dependency list, see the [Mega / Orion Demo architecture design document](./mega-orion-demo-compose-arch.md).
536535

‎docker/demo/.env.example‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,10 @@ S3_REGION=us-east-1
5151
# All images are pulled from Amazon ECR Public: public.ecr.aws/m8q5m4u3/mega
5252
# You can override these to use local images or different tags
5353

54-
MEGA_ENGINE_IMAGE=public.ecr.aws/m8q5m4u3/mega:mono-0.1.0-pre-release
55-
MEGA_UI_IMAGE=public.ecr.aws/m8q5m4u3/mega:mega-ui-demo-0.1.0-pre-release
56-
ORION_SERVER_IMAGE=public.ecr.aws/m8q5m4u3/mega:orion-server-0.1.0-pre-release
57-
MEGA_DEV_IMAGE=public.ecr.aws/m8q5m4u3/mega:orion-client-0.1.0-pre-release
58-
CAMPSITE_API_IMAGE=public.ecr.aws/m8q5m4u3/mega:campsite-0.1.0-pre-release
54+
MEGA_ENGINE_IMAGE=public.ecr.aws/m8q5m4u3/mega/mono-engine:latest
55+
MEGA_UI_IMAGE=public.ecr.aws/m8q5m4u3/mega/mega-ui:demo-latest
56+
ORION_SERVER_IMAGE=public.ecr.aws/m8q5m4u3/mega/orion-server:latest
57+
CAMPSITE_API_IMAGE=public.ecr.aws/m8q5m4u3/mega/campsite-api:latest
5958

6059
# ----------------------------------------------------------------------------
6160
# Mega Backend Service Configuration

‎docker/demo/docker-compose.demo.yml‎

Lines changed: 7 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,12 @@ services:
101101
# ---------------------------------------------------------------------------
102102
# Mega / Mono Engine (Rust backend)
103103
# ---------------------------------------------------------------------------
104-
# Use pre-built image from ECR Public: public.ecr.aws/m8q5m4u3/mega:mono-0.1.0-pre-release
104+
# Use pre-built image from ECR Public: public.ecr.aws/m8q5m4u3/mega/mono-engine:latest
105105
# Or use locally built image: mega:mono-engine-latest (after building with docker build)
106106
# Set MEGA_ENGINE_IMAGE environment variable to override
107107
# Priority: MEGA_ENGINE_IMAGE env var > local build (mega:mono-engine-latest) > ECR image
108108
mega:
109-
image: ${MEGA_ENGINE_IMAGE:-public.ecr.aws/m8q5m4u3/mega:mono-0.1.0-pre-release}
109+
image: ${MEGA_ENGINE_IMAGE:-public.ecr.aws/m8q5m4u3/mega/mono-engine:latest}
110110
container_name: mega-demo-backend
111111
depends_on:
112112
postgres:
@@ -207,12 +207,12 @@ services:
207207
# ---------------------------------------------------------------------------
208208
# Mega UI (Next.js)
209209
# ---------------------------------------------------------------------------
210-
# Use pre-built image from ECR Public: public.ecr.aws/m8q5m4u3/mega:mega-ui-{env}-0.1.0-pre-release
210+
# Use pre-built image from ECR Public: public.ecr.aws/m8q5m4u3/mega/mega-ui:{env}-latest
211211
# Available environments: staging, openatom, gitmono
212212
# Set MEGA_UI_IMAGE environment variable to use ECR image, or tag the ECR image as mega:mono-ui-latest-release
213213
# Default uses local tag (mega:mono-ui-latest-release) if ECR image is tagged locally
214214
mega_ui:
215-
image: ${MEGA_UI_IMAGE:-public.ecr.aws/m8q5m4u3/mega:mega-ui-demo-0.1.0-pre-release}
215+
image: ${MEGA_UI_IMAGE:-public.ecr.aws/m8q5m4u3/mega/mega-ui:demo-latest}
216216
container_name: mega-demo-ui
217217
depends_on:
218218
mega:
@@ -244,7 +244,7 @@ services:
244244
# build:
245245
# context: ..
246246
# dockerfile: orion-server/Dockerfile
247-
image: ${ORION_SERVER_IMAGE:-public.ecr.aws/m8q5m4u3/mega:orion-server-0.1.0-pre-release}
247+
image: ${ORION_SERVER_IMAGE:-public.ecr.aws/m8q5m4u3/mega/orion-server:latest}
248248
container_name: mega-demo-orion-server
249249
depends_on:
250250
postgres:
@@ -275,42 +275,13 @@ services:
275275
aliases:
276276
- orion.gitmono.local
277277

278-
# ---------------------------------------------------------------------------
279-
# Orion Build Client / Worker (based on orion-client image)
280-
# ---------------------------------------------------------------------------
281-
orion_build_client:
282-
image: ${ORION_CLIENT_IMAGE:-public.ecr.aws/m8q5m4u3/mega:orion-client-0.1.0-pre-release}
283-
container_name: mega-demo-orion-worker
284-
command: orion
285-
# privileged mode allows nested container builds (Scorpio) inside the worker.
286-
privileged: true
287-
depends_on:
288-
orion_server:
289-
condition: service_started
290-
environment:
291-
SERVER_WS: ${ORION_WORKER_SERVER_WS:-ws://orion_server:8004/ws}
292-
ORION_WORKER_ID: ${ORION_WORKER_ID:-}
293-
BUCK_PROJECT_ROOT: ${BUCK_PROJECT_ROOT:-/workspace}
294-
BUILD_TMP: ${BUILD_TMP:-/tmp/orion-builds}
295-
SCORPIO_API_BASE_URL: ${SCORPIO_API_BASE_URL:-http://127.0.0.1:2725}
296-
ORION_WORKER_START_SCORPIO: ${ORION_WORKER_START_SCORPIO:-true}
297-
SCORPIO_BASE_URL: ${SCORPIO_BASE_URL:-http://mega:8000}
298-
SCORPIO_LFS_URL: ${SCORPIO_LFS_URL:-http://mega:8000}
299-
SCORPIO_STORE_PATH: /data/scorpio/store
300-
SCORPIO_WORKSPACE: /workspace/mount
301-
RUST_LOG: ${RUST_LOG:-info}
302-
volumes:
303-
- orion-worker-scorpio-data:/data/scorpio
304-
- orion-worker-workspace:/workspace
305-
restart: unless-stopped
306-
307278
# ---------------------------------------------------------------------------
308279
# Campsite API (Ruby)
309280
# ---------------------------------------------------------------------------
310-
# Use pre-built image from ECR Public: public.ecr.aws/m8q5m4u3/mega:campsite-0.1.0-pre-release
281+
# Use pre-built image from ECR Public: public.ecr.aws/m8q5m4u3/mega/campsite-api:latest
311282
# Note: Campsite API requires MySQL database, not PostgreSQL
312283
campsite_api:
313-
image: ${CAMPSITE_API_IMAGE:-public.ecr.aws/m8q5m4u3/mega:campsite-0.1.0-pre-release}
284+
image: ${CAMPSITE_API_IMAGE:-public.ecr.aws/m8q5m4u3/mega/campsite-api:latest}
314285
container_name: mega-demo-campsite-api
315286
depends_on:
316287
mysql:
@@ -377,5 +348,3 @@ volumes:
377348
rustfs-data:
378349
mega-data:
379350
orion-logs:
380-
orion-worker-scorpio-data:
381-
orion-worker-workspace:

0 commit comments

Comments
 (0)