Selected Docker Image Build & Push #38
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: Selected Docker Image Build & Push | |
on: | |
workflow_dispatch: | |
inputs: | |
dockerfile: | |
description: Type Dockerfile version to build | |
required: true | |
default: cpu | |
type: choice | |
options: | |
- cpu | |
- desktop | |
- jetson | |
build_type: | |
description: Is it a "development" or a "stable" release? | |
required: true | |
default: development | |
type: choice | |
options: | |
- development | |
- stable | |
target_distro: | |
description: In case of "stable" release specify the ROS distro of the existing docker image (eg. | |
humble) | |
type: string | |
default: ardent | |
target_release: | |
description: In case of "stable" release specify the version of the existing docker image (eg. | |
1.0.12) | |
type: string | |
default: 0.0.0 | |
target_date: | |
description: In case of "stable" release specify the date of the existing docker image in format | |
YYYYMMDD (eg. 20220124) | |
type: string | |
default: '20131206' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Maximize build space | |
uses: easimon/maximize-build-space@master | |
with: | |
root-reserve-mb: 25840 | |
remove-dotnet: 'true' | |
remove-android: 'true' | |
remove-haskell: 'true' | |
- name: Set variables | |
run: | | |
if [[ "${{ inputs.dockerfile }}" == "desktop" ]]; then | |
echo "REPO_NAME=zed-desktop" >> $GITHUB_ENV | |
echo "ROS_DISTRO=humble" >> $GITHUB_ENV | |
echo "PLATFORM=linux/amd64" >> $GITHUB_ENV | |
elif [[ "${{ inputs.dockerfile }}" == "cpu" ]]; then | |
echo "REPO_NAME=zed-desktop-cpu" >> $GITHUB_ENV | |
echo "ROS_DISTRO=humble" >> $GITHUB_ENV | |
echo "PLATFORM=linux/amd64, linux/arm64" >> $GITHUB_ENV | |
elif [[ "${{ inputs.dockerfile }}" == "jetson" ]]; then | |
echo "REPO_NAME=zed-jetson" >> $GITHUB_ENV | |
echo "ROS_DISTRO=foxy" >> $GITHUB_ENV | |
echo "PLATFORM=linux/arm64" >> $GITHUB_ENV | |
fi | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Build Docker Image | |
uses: husarion-ci/[email protected] | |
with: | |
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }} | |
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }} | |
main_branch_name: ros2 | |
dockerfile: Dockerfile.${{ inputs.dockerfile }} | |
repo_name: ${{ env.REPO_NAME }} | |
build_type: ${{ inputs.build_type }} | |
ros_distro: ${{ env.ROS_DISTRO }} | |
platforms: ${{ env.PLATFORM }} | |
# variables important only for stable release | |
target_distro: ${{ inputs.target_distro }} | |
target_release: ${{ inputs.target_release }} | |
target_date: ${{ inputs.target_date }} |