Skip to repository content

tenant.openagents/omega

No repository description is available.

OpenAgents Git authority 2026-07-28T02:22:44.896Z Public web read
NIP-34 coordinate30617:7649603503856e5148d571eac2766b288a8ff1e9e35d380337a1d2b0015b4f92:omega
MaintainersHidden in public view
References2 branches · 1 tag
Read-only clonegit clone https://openagents.com/git/tenant.openagents/omega.git
Browse files

deploy_collab.yml

172 lines · 6.3 KB · yaml
1# Generated from xtask::workflows::deploy_collab
2# Rebuild with `cargo xtask workflows`.
3name: deploy_collab
4env:
5  DOCKER_BUILDKIT: '1'
6on:
7  push:
8    tags:
9    - collab-production
10permissions:
11  contents: read
12jobs:
13  style:
14    if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
15    name: Check formatting and Clippy lints
16    runs-on: namespace-profile-16x32-ubuntu-2204
17    env:
18      CC: clang
19      CXX: clang++
20    steps:
21    - name: steps::checkout_repo
22      uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
23      with:
24        clean: false
25        fetch-depth: 0
26    - name: steps::setup_cargo_config
27      run: |
28        mkdir -p ./../.cargo
29        cp ./.cargo/ci-config.toml ./../.cargo/config.toml
30    - name: steps::cache_rust_dependencies_namespace
31      uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
32      with:
33        cache: rust
34        path: ~/.rustup
35    - name: steps::setup_linux
36      run: ./script/linux
37    - name: steps::download_wasi_sdk
38      run: ./script/download-wasi-sdk
39    - name: steps::cargo_fmt
40      run: cargo fmt --all -- --check
41    - name: steps::clippy
42      run: ./script/clippy
43  tests:
44    needs:
45    - style
46    name: Run tests
47    runs-on: namespace-profile-16x32-ubuntu-2204
48    env:
49      CC: clang
50      CXX: clang++
51    steps:
52    - name: steps::checkout_repo
53      uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
54      with:
55        clean: false
56        fetch-depth: 0
57    - name: steps::setup_cargo_config
58      run: |
59        mkdir -p ./../.cargo
60        cp ./.cargo/ci-config.toml ./../.cargo/config.toml
61    - name: steps::cache_rust_dependencies_namespace
62      uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
63      with:
64        cache: rust
65        path: ~/.rustup
66    - name: steps::setup_linux
67      run: ./script/linux
68    - name: steps::download_wasi_sdk
69      run: ./script/download-wasi-sdk
70    - name: steps::cargo_install_nextest
71      uses: taiki-e/install-action@a6b2e2dcd845ddd7f509ce4f3ed3d922b80cc5d9
72      with:
73        tool: nextest
74    - name: steps::clear_target_dir_if_large
75      run: ./script/clear-target-dir-if-larger-than 350 200
76    - name: deploy_collab::tests::run_collab_tests
77      run: cargo nextest run --package collab --no-fail-fast
78    services:
79      postgres:
80        image: postgres:15@sha256:1b92e7a80c021647bf70f5d3eb66066a998e4f5cf43c07bb9dc9f729782cf88e
81        env:
82          POSTGRES_HOST_AUTH_METHOD: trust
83        ports:
84        - 5432:5432
85        options: --health-cmd pg_isready --health-interval 500ms --health-timeout 5s --health-retries 10
86  publish:
87    needs:
88    - style
89    - tests
90    name: Publish collab server image
91    runs-on: namespace-profile-16x32-ubuntu-2204
92    steps:
93    - name: deploy_collab::publish::install_doctl
94      uses: digitalocean/action-doctl@3cb3953159719656269e044e0e24ca16dd2a690f
95      with:
96        token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
97    - name: deploy_collab::publish::sign_into_registry
98      run: doctl registry login
99    - name: steps::checkout_repo
100      uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
101      with:
102        clean: false
103    - name: deploy_collab::publish::build_docker_image
104      run: |
105        docker build -f Dockerfile-collab \
106          --build-arg "GITHUB_SHA=$GITHUB_SHA" \
107          --tag "registry.digitalocean.com/zed/collab:$GITHUB_SHA" \
108          .
109    - name: deploy_collab::publish::publish_docker_image
110      run: docker push "registry.digitalocean.com/zed/collab:${GITHUB_SHA}"
111    - name: deploy_collab::publish::prune_docker_system
112      run: docker system prune --filter 'until=72h' -f
113  deploy:
114    needs:
115    - publish
116    name: Deploy new server image
117    runs-on: namespace-profile-16x32-ubuntu-2204
118    steps:
119    - name: steps::checkout_repo
120      uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
121      with:
122        clean: false
123    - name: deploy_collab::deploy::install_doctl
124      uses: digitalocean/action-doctl@3cb3953159719656269e044e0e24ca16dd2a690f
125      with:
126        token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
127    - name: deploy_collab::deploy::sign_into_kubernetes
128      run: doctl kubernetes cluster kubeconfig save --expiry-seconds 600 "$CLUSTER_NAME"
129      env:
130        CLUSTER_NAME: ${{ secrets.CLUSTER_NAME }}
131    - name: deploy_collab::deploy::start_rollout
132      run: |
133        set -eu
134        if [[ $GITHUB_REF_NAME = "collab-production" ]]; then
135          export ZED_KUBE_NAMESPACE=production
136          export ZED_COLLAB_LOAD_BALANCER_SIZE_UNIT=10
137          export ZED_API_LOAD_BALANCER_SIZE_UNIT=2
138        elif [[ $GITHUB_REF_NAME = "collab-staging" ]]; then
139          export ZED_KUBE_NAMESPACE=staging
140          export ZED_COLLAB_LOAD_BALANCER_SIZE_UNIT=1
141          export ZED_API_LOAD_BALANCER_SIZE_UNIT=1
142        else
143          echo "cowardly refusing to deploy from an unknown branch"
144          exit 1
145        fi
146
147        echo "Deploying collab:$GITHUB_SHA to $ZED_KUBE_NAMESPACE"
148
149        source script/lib/deploy-helpers.sh
150        export_vars_for_environment "$ZED_KUBE_NAMESPACE"
151
152        ZED_DO_CERTIFICATE_ID="$(doctl compute certificate list --format ID --no-header)"
153        export ZED_DO_CERTIFICATE_ID
154        export ZED_IMAGE_ID="registry.digitalocean.com/zed/collab:${GITHUB_SHA}"
155
156        export ZED_SERVICE_NAME=collab
157        export ZED_LOAD_BALANCER_SIZE_UNIT=$ZED_COLLAB_LOAD_BALANCER_SIZE_UNIT
158        export DATABASE_MAX_CONNECTIONS=850
159        envsubst < crates/collab/k8s/collab.template.yml | kubectl apply -f -
160        kubectl -n "$ZED_KUBE_NAMESPACE" rollout status "deployment/$ZED_SERVICE_NAME" --watch
161        echo "deployed ${ZED_SERVICE_NAME} to ${ZED_KUBE_NAMESPACE}"
162
163        export ZED_SERVICE_NAME=api
164        export ZED_LOAD_BALANCER_SIZE_UNIT=$ZED_API_LOAD_BALANCER_SIZE_UNIT
165        export DATABASE_MAX_CONNECTIONS=60
166        envsubst < crates/collab/k8s/collab.template.yml | kubectl apply -f -
167        kubectl -n "$ZED_KUBE_NAMESPACE" rollout status "deployment/$ZED_SERVICE_NAME" --watch
168        echo "deployed ${ZED_SERVICE_NAME} to ${ZED_KUBE_NAMESPACE}"
169defaults:
170  run:
171    shell: bash -euxo pipefail {0}
172
Served at tenant.openagents/omega Member data and write actions are omitted.