Skip to content

better model filtering for comp. #45

better model filtering for comp.

better model filtering for comp. #45

name: Build and Push Docker Images
on:
push:
branches:
- main
tags:
- "v*"
pull_request:
branches:
- main
env:
REGISTRY: docker.io
BACKEND_IMAGE_NAME: otrta-backend
FRONTEND_IMAGE_NAME: otrta-frontend
jobs:
test-backend:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y protobuf-compiler
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Cache Rust dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Check formatting
run: cargo fmt --all -- --check
working-directory: ./crates
test-frontend:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
cache: "npm"
cache-dependency-path: "./ui/package-lock.json"
- name: Install dependencies
run: npm ci
working-directory: ./ui
- name: Run linting
run: npm run lint
working-directory: ./ui
- name: Run type checking
run: npm run build
working-directory: ./ui
deploy-info:
runs-on: ubuntu-latest
needs: [test-backend, test-frontend]
if: github.event_name != 'pull_request'
steps:
- name: Display deployment info
run: |
echo "🚀 Docker images built and pushed successfully!"
echo ""
echo "📦 Backend Image: ${{ env.REGISTRY }}/${{ secrets.DOCKERHUB_USERNAME }}/${{ env.BACKEND_IMAGE_NAME }}"
echo "📦 Frontend Image: ${{ env.REGISTRY }}/${{ secrets.DOCKERHUB_USERNAME }}/${{ env.FRONTEND_IMAGE_NAME }}"
echo ""
echo "🏷️ Tagged with:"
echo " - latest (if main branch)"
echo " - version number (if tagged release)"
echo " - commit SHA"
echo ""
echo "🎯 To deploy, update your docker-compose.yml or Kubernetes manifests"
echo " with the new image tags."