-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbuild_and_publish_debian_docker.yaml
More file actions
96 lines (91 loc) · 3.45 KB
/
build_and_publish_debian_docker.yaml
File metadata and controls
96 lines (91 loc) · 3.45 KB
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
---
name: Build and publish debian docker images
on:
workflow_dispatch:
push:
branches:
- master
paths:
- '.github/workflows/build_and_publish_debian_docker.yaml'
- 'ros2_debian/**'
pull_request:
paths:
- '.github/workflows/build_and_publish_debian_docker.yaml'
- 'ros2_debian/**'
- 'ros_controls.*.repos'
schedule:
- cron: '0 1 * * MON'
concurrency:
# cancel previous runs of the same workflow, except for pushes on given branches
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ !startsWith(github.ref, 'refs/heads') }}
jobs:
build_images:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
include:
- ros_distro: 'humble'
debian_version: 'debian11'
exclude_packages: ''
- ros_distro: 'jazzy'
debian_version: 'debian12'
exclude_packages: ''
- ros_distro: 'kilted'
debian_version: 'debian12'
exclude_packages: ''
- ros_distro: 'rolling'
debian_version: 'debian12'
exclude_packages: ''
steps:
- uses: actions/checkout@v6
- uses: docker/setup-buildx-action@v4
- name: Set image tag
id: image_meta
run: |
tag_suffix=""
if [ "${{ github.event_name }}" = "pull_request" ]; then
tag_suffix="-pr-${{ github.event.pull_request.number }}"
fi
echo "image_tag=${{ matrix.ros_distro }}-debian${tag_suffix}" >> "$GITHUB_OUTPUT"
- uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push image
uses: docker/build-push-action@v7
with:
context: .
push: true
provenance: false
sbom: false
file: ros2_debian/Dockerfile.${{ matrix.debian_version }}
tags: ghcr.io/${{ github.repository_owner }}/ros:${{ steps.image_meta.outputs.image_tag }}
labels: |
org.opencontainers.image.source=https://github.com/ros-controls/ros2_control_ci
org.opencontainers.image.description=${{ matrix.debian_version }} for ros-controls CI
org.opencontainers.image.licenses=Apache-2.0
cache-from: ${{ github.event_name != 'schedule' && format('type=gha,scope=debian-{0}', matrix.ros_distro) || '' }}
cache-to: type=gha,scope=debian-${{ matrix.ros_distro }},mode=max
build-args: |
ROS_DISTRO=${{ matrix.ros_distro }}
EXCLUDE_PACKAGES=gz_ros2_control gz_ros2_control_demos ign_ros2_control mujoco_ros2_control ros_gz_sim ros_gz_bridge rviz2 eigenpy hpp-fcl ${{ matrix.exclude_packages }}
stack-build:
if: ${{ github.event_name == 'pull_request' }}
needs: build_images
uses: ./.github/workflows/reusable-debian-build.yml
strategy:
fail-fast: false
matrix:
ROS_DISTRO: [rolling, humble, jazzy, kilted]
with:
ros_distro: ${{ matrix.ROS_DISTRO }}
target_workspace: ros_controls.${{ matrix.ROS_DISTRO }}.repos
skip_packages_regex: '^mujoco_ros2_control.*$|^gz_ros2_control.*$|^ros2_control_demo_example_9$|^ros2_control_demos$|^ign_ros2_control.*$'
ref_for_scheduled_build: master
docker_image_tag_suffix: ${{ format('-pr-{0}', github.event.pull_request.number) }}