Skip to content

Deploy Node Daemon

Deploy Node Daemon #12

Workflow file for this run

name: Deploy Node Daemon
on:
push:
branches: [main]
paths:
- 'crates/**'
- 'packages/contract/proto/**'
- 'Cargo.toml'
- 'Cargo.lock'
workflow_dispatch:
concurrency:
group: deploy-node
cancel-in-progress: false
env:
CARGO_TERM_COLOR: always
jobs:
check:
name: Test & Lint Rust
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Install protobuf compiler
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Test sandchest-agent
run: cargo test -p sandchest-agent
- name: Test sandchest-node
run: cargo test -p sandchest-node
- run: cargo clippy --workspace -- -D warnings
build-and-upload:
name: Build & Upload to R2
needs: check
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Install protobuf compiler
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Build release binary
run: cargo build --release --package sandchest-node
- name: Upload binary artifact
uses: actions/upload-artifact@v4
with:
name: sandchest-node-${{ github.sha }}
path: target/release/sandchest-node
retention-days: 30
- name: Upload binary to R2
env:
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: auto
run: |
aws s3 cp target/release/sandchest-node \
"s3://${{ secrets.R2_BUCKET }}/binaries/sandchest-node/${{ github.sha }}/sandchest-node" \
--endpoint-url "${{ secrets.R2_ENDPOINT }}"
aws s3 cp target/release/sandchest-node \
"s3://${{ secrets.R2_BUCKET }}/binaries/sandchest-node/latest/sandchest-node" \
--endpoint-url "${{ secrets.R2_ENDPOINT }}"
# Deployment to individual nodes is handled via the admin app's
# "Deploy Daemon" button, which pulls the binary from R2.
# No direct SSH needed — scales to any number of servers.