Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/tentou.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: "tentou deploy"

on:
push:
branches: [ "hyper-evm" ]

jobs:
build:
runs-on: ubuntu-latest
env:
MIGRATIONS_IMAGE: ghcr.io/tentou-tech/cow-migrations
ORDERBOOK_IMAGE: ghcr.io/tentou-tech/cow-orderbook
AUTOPILOT_IMAGE: ghcr.io/tentou-tech/cow-autopilot
DRIVER_IMAGE: ghcr.io/tentou-tech/cow-driver
BASELINE_IMAGE: ghcr.io/tentou-tech/cow-baseline
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set environment variable
run: |
SHORT_SHA_COMMIT=$(git rev-parse --short HEAD)
echo IMAGE_TAG=${GITHUB_REF_NAME}_${SHORT_SHA_COMMIT} >> $GITHUB_ENV
- name: Build & Push Images
run: |
docker buildx build -t $MIGRATIONS_IMAGE:${{ env.IMAGE_TAG }} --target migrations --push .
docker buildx build -t $ORDERBOOK_IMAGE:${{ env.IMAGE_TAG }} --target orderbook --push .
docker buildx build -t $AUTOPILOT_IMAGE:${{ env.IMAGE_TAG }} --target autopilot --push .
docker buildx build -t $DRIVER_IMAGE:${{ env.IMAGE_TAG }} --target driver --push .
docker buildx build -t $BASELINE_IMAGE:${{ env.IMAGE_TAG }} --target solvers --push .
updategitops:
runs-on: ubuntu-latest
needs: build
env:
MIGRATIONS_IMAGE: ghcr.io/tentou-tech/cow-migrations
ORDERBOOK_IMAGE: ghcr.io/tentou-tech/cow-orderbook
AUTOPILOT_IMAGE: ghcr.io/tentou-tech/cow-autopilot
DRIVER_IMAGE: ghcr.io/tentou-tech/cow-driver
BASELINE_IMAGE: ghcr.io/tentou-tech/cow-baseline
steps:
- uses: actions/checkout@v4
- name: Set environment variable
run: |
SHORT_SHA_COMMIT=$(git rev-parse --short HEAD)
echo IMAGE_TAG=${GITHUB_REF_NAME}_${SHORT_SHA_COMMIT} >> $GITHUB_ENV
- name: Update GitOps repo
run: |
git clone https://${{ secrets.REGISTRY_PASSWORD }}@github.com/tentou-tech/gitops.git
cd gitops/clusters/k8s-dev/cow-protocol

curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
./kustomize edit set image image_migrations=$MIGRATIONS_IMAGE:${{ env.IMAGE_TAG }}
./kustomize edit set image image_orderbook=$ORDERBOOK_IMAGE:${{ env.IMAGE_TAG }}
./kustomize edit set image image_autopilot=$AUTOPILOT_IMAGE:${{ env.IMAGE_TAG }}
./kustomize edit set image image_driver=$DRIVER_IMAGE:${{ env.IMAGE_TAG }}
./kustomize edit set image image_baseline=$BASELINE_IMAGE:${{ env.IMAGE_TAG }}
rm kustomize

git config user.name "ci-bot"
git config user.email "ci@bot"
git commit -am "Update images to ${GITHUB_SHA::8}"

git push
31 changes: 31 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ contracts = { path = "crates/contracts" }
cow-amm = { path = "crates/cow-amm" }
database = { path = "crates/database" }
driver = { path = "crates/driver" }
driver-hyperliquid-template = { path = "crates/driver-hyperliquid-template" }
ethrpc = { path = "crates/ethrpc" }
model = { path = "crates/model" }
moka = "0.12.10"
Expand Down
Loading
Loading