Skip to content

Commit 2107b28

Browse files
committed
unified docker workflow
1 parent 900a722 commit 2107b28

File tree

3 files changed

+76
-86
lines changed

3 files changed

+76
-86
lines changed

.github/workflows/docker-base-ros-python.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

.github/workflows/docker-base-ros.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.github/workflows/docker.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: docker-tree
2+
on:
3+
push:
4+
branches: [ env/devcontainer2 ]
5+
6+
jobs:
7+
detect-changes: # single job that figures out WHAT changed
8+
runs-on: dimos-runner-ubuntu-2204
9+
outputs:
10+
ros: ${{ steps.filter.outputs.ros }}
11+
python: ${{ steps.filter.outputs.python }}
12+
steps:
13+
- uses: actions/checkout@v4
14+
- id: filter
15+
uses: dorny/paths-filter@v3
16+
with:
17+
filters: |
18+
ros: docker/base-ros/**
19+
python: docker/base-python/**
20+
21+
build-ros:
22+
needs: detect-changes
23+
if: needs.detect-changes.outputs.ros == 'true'
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
29+
- uses: docker/login-action@v3
30+
with:
31+
registry: ghcr.io
32+
username: ${{ github.actor }}
33+
password: ${{ secrets.GITHUB_TOKEN }}
34+
35+
- name: Set up Docker Buildx
36+
uses: docker/setup-buildx-action@v3
37+
38+
- name: Build and push
39+
uses: docker/build-push-action@v6
40+
with:
41+
push: true
42+
context: .
43+
file: docker/base-ros/Dockerfile
44+
tags: ghcr.io/dimensionalos/base-ros:latest
45+
cache-from: type=gha
46+
cache-to: type=gha,mode=max
47+
48+
49+
build-python:
50+
needs: [detect-changes, build-ros]
51+
if: |
52+
needs.detect-changes.outputs.python == 'true' ||
53+
needs.build-ros.result == 'success'
54+
runs-on: ubuntu-latest
55+
steps:
56+
- name: Checkout
57+
uses: actions/checkout@v4
58+
59+
- uses: docker/login-action@v3
60+
with:
61+
registry: ghcr.io
62+
username: ${{ github.actor }}
63+
password: ${{ secrets.GITHUB_TOKEN }}
64+
65+
- name: Set up Docker Buildx
66+
uses: docker/setup-buildx-action@v3
67+
68+
- name: Build and push
69+
uses: docker/build-push-action@v6
70+
with:
71+
push: true
72+
context: .
73+
file: docker/base-ros-python/Dockerfile
74+
tags: ghcr.io/dimensionalos/base-ros-python:latest
75+
cache-from: type=gha
76+
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)