Improve docker workflows and add rhel and debian stack build #137
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| 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/**' | |
| 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' | |
| source_packages: filters xacro diagnostic_updater backward_ros generate_parameter_library angles ackermann_msgs pal_statistics topic_tools | |
| - ros_distro: 'jazzy' | |
| debian_version: 'debian12' | |
| source_packages: filters xacro diagnostic_updater backward_ros generate_parameter_library angles ackermann_msgs sdformat_urdf pal_statistics pinocchio topic_tools | |
| - ros_distro: 'kilted' | |
| debian_version: 'debian12' | |
| source_packages: filters xacro diagnostic_updater backward_ros generate_parameter_library angles ackermann_msgs sdformat_urdf pal_statistics pinocchio topic_tools | |
| - ros_distro: 'rolling' | |
| debian_version: 'debian12' | |
| source_packages: filters xacro diagnostic_updater backward_ros generate_parameter_library angles ackermann_msgs sdformat_urdf pal_statistics pinocchio topic_tools | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: docker/setup-buildx-action@v3 | |
| - 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@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: ros2_debian | |
| 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 }} | |
| SOURCE_PACKAGES=${{ matrix.source_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) }} |