Skip to content

Docker Build Nova Rerun Bridge #19

Docker Build Nova Rerun Bridge

Docker Build Nova Rerun Bridge #19

name: Docker Build Nova Rerun Bridge
on:
workflow_run:
workflows: ["Release"]
types:
- completed
branches:
- main
env:
REGISTRY: wandelbots.azurecr.io
IMAGE_NAME: nova-apps/nova-rerun-bridge
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install GLTF Transform CLI
run: npm install -g @gltf-transform/cli
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
- name: Download Robot Models
run: |
poetry install --extras "nova-rerun-bridge"
poetry run download-models
- name: Create and populate nova_rerun_bridge_app directory
run: |
# Create temp directory
rm -rf temp_build
mkdir -p temp_build
DIRS_TO_COPY=("models" "nova" "nova_rerun_bridge")
FILES_TO_COPY=("pyproject.toml" "poetry.lock" "README.md")
# Copy to temp directory first
for dir in "${DIRS_TO_COPY[@]}"; do
if [ -d "$dir" ]; then
echo "Copying $dir..."
cp -r "$dir" temp_build/
else
echo "Warning: Directory $dir not found"
fi
done
for file in "${FILES_TO_COPY[@]}"; do
if [ -f "$file" ]; then
echo "Copying $file..."
cp "$file" temp_build/
else
echo "Warning: File $file not found"
fi
done
# Move to final destination
mv temp_build/* nova_rerun_bridge/nova_rerun_bridge_app/
rm -rf temp_build
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Get version from pyproject.toml
id: version
run: |
version=$(grep '^version = ' nova_rerun_bridge/nova_rerun_bridge_app/pyproject.toml | cut -d'"' -f2)
echo "version=$version" >> $GITHUB_OUTPUT
- name: Login to Azure Container Registry
if: github.ref == 'refs/heads/main'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.PUBLIC_REGISTRY_CI_SCOPE_NOVA_APPS_USERNAME }}
password: ${{ secrets.PUBLIC_REGISTRY_CI_SCOPE_NOVA_APPS_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v6
with:
context: ./nova_rerun_bridge/nova_rerun_bridge_app
push: ${{ github.ref == 'refs/heads/main' }}
load: ${{ github.ref != 'refs/heads/main' }}
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Verify Image
if: github.ref != 'refs/heads/main'
run: |
echo "Checking built image..."
echo "Version: ${{ steps.version.outputs.version }}"
docker images | grep ${{ env.IMAGE_NAME }}