-
Notifications
You must be signed in to change notification settings - Fork 1
104 lines (88 loc) · 3.01 KB
/
push_nova_rerun_bridge_image.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Docker Build Nova Rerun Bridge
on:
workflow_run:
workflows: ["Release"]
types:
- completed
branches:
- main
pull_request:
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
poetry run download-models
- name: Create and populate nova_rerun_bridge_app directory
run: |
DIRS_TO_COPY=("models" "nova_rerun_bridge" "nova")
FILES_TO_COPY=("pyproject.toml" "poetry.lock" "README.md")
for dir in "${DIRS_TO_COPY[@]}"; do
if [ -d "$dir" ]; then
echo "Copying $dir..."
cp -r "$dir" nova_rerun_bridge/nova_rerun_bridge_app/
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" nova_rerun_bridge/nova_rerun_bridge_app/
else
echo "Warning: File $file not found"
fi
done
- 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 }}