Build Docker image #14798
Workflow file for this run
This file contains 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 Docker image" | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
schedule: | |
# Run the CI automatically every day to look for flakyness. | |
- cron: '0 0 * * *' | |
jobs: | |
build_ubuntu_docker_image: | |
strategy: | |
fail-fast: false | |
matrix: | |
base_image_name: [ubuntu] | |
base_image_tag: [focal, jammy] | |
name: "${{ matrix.base_image_name }}-${{ matrix.base_image_tag }}" | |
# always use latest linux worker, as it should not have any impact | |
# when it comes to building docker images. | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout repository | |
uses: actions/checkout@v2 | |
- | |
name: Set up docker buildx | |
uses: docker/setup-buildx-action@v1 | |
- | |
name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- | |
name: Login to Github Container Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- | |
name: Build and push | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
platforms: linux/amd64 | |
push: ${{ github.event_name != 'pull_request' }} | |
build-args: | | |
BASE_IMAGE_NAME=${{ matrix.base_image_name }} | |
BASE_IMAGE_TAG=${{ matrix.base_image_tag }} | |
VCS_REF=${{ github.sha }} | |
ROS_DISTRO=none | |
tags: | | |
rostooling/setup-ros-docker:${{ matrix.base_image_name }}-${{ matrix.base_image_tag }}-latest | |
ghcr.io/ros-tooling/setup-ros-docker/setup-ros-docker-${{ matrix.base_image_name }}-${{ matrix.base_image_tag }}:master | |
build_ubuntu_docker_image_ros: | |
strategy: | |
fail-fast: false | |
matrix: | |
base_image_name: [ubuntu] | |
ros_distro: [noetic, humble, iron, rolling] | |
ros_variant: [desktop, ros-base] | |
include: | |
# Noetic Ninjemys (May 2020 - May 2025) | |
- ros_distro: noetic | |
base_image_tag: focal | |
ros_variant: desktop | |
output_image_tag: ubuntu-focal-ros-noetic-desktop | |
- ros_distro: noetic | |
base_image_tag: focal | |
ros_variant: ros-base | |
output_image_tag: ubuntu-focal-ros-noetic-ros-base | |
# Humble Hawksbill (May 2022 - May 2027) | |
- ros_distro: humble | |
base_image_tag: jammy | |
ros_variant: desktop | |
output_image_tag: ubuntu-jammy-ros-humble-desktop | |
- ros_distro: humble | |
base_image_tag: jammy | |
ros_variant: ros-base | |
output_image_tag: ubuntu-jammy-ros-humble-ros-base | |
# Iron Irwini (May 2023 - November 2024) | |
- ros_distro: iron | |
base_image_tag: jammy | |
ros_variant: desktop | |
output_image_tag: ubuntu-jammy-ros-iron-desktop | |
- ros_distro: iron | |
base_image_tag: jammy | |
ros_variant: ros-base | |
output_image_tag: ubuntu-jammy-ros-iron-ros-base | |
# Rolling Ridley (June 2020 - Ongoing) | |
- ros_distro: rolling | |
base_image_tag: jammy | |
ros_variant: desktop | |
output_image_tag: ubuntu-jammy-ros-rolling-desktop | |
- ros_distro: rolling | |
base_image_tag: jammy | |
ros_variant: ros-base | |
output_image_tag: ubuntu-jammy-ros-rolling-ros-base | |
name: "${{ matrix.output_image_tag }}" | |
# always use latest linux worker, as it should not have any impact | |
# when it comes to building docker images. | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout repository | |
uses: actions/checkout@v2 | |
- | |
name: Set up docker buildx | |
uses: docker/setup-buildx-action@v1 | |
- | |
name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- | |
name: Login to Github Container Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- | |
name: Build and push | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
platforms: linux/amd64 | |
push: ${{ github.event_name != 'pull_request' }} | |
build-args: | | |
BASE_IMAGE_NAME=${{ matrix.base_image_name }} | |
BASE_IMAGE_TAG=${{ matrix.base_image_tag }} | |
EXTRA_APT_PACKAGES=ros-${{ matrix.ros_distro }}-${{ matrix.ros_variant }} | |
VCS_REF=${{ github.sha }} | |
ROS_DISTRO=${{ matrix.ros_distro }} | |
tags: | | |
rostooling/setup-ros-docker:${{ matrix.output_image_tag }}-latest | |
ghcr.io/ros-tooling/setup-ros-docker/setup-ros-docker-${{ matrix.output_image_tag }}:master |