|
| 1 | +--- |
| 2 | +name: Build Docker |
| 3 | + |
| 4 | +on: |
| 5 | + workflow_call: |
| 6 | + inputs: |
| 7 | + branch_name: |
| 8 | + description: Tag used in the docker image (branch/tag/commit). |
| 9 | + required: true |
| 10 | + type: string |
| 11 | + build_type: |
| 12 | + description: Is it a "development" or a "stable" release? |
| 13 | + required: true |
| 14 | + type: string |
| 15 | + default: development |
| 16 | + target_distro: |
| 17 | + description: In case of "stable" release specify the ROS distro of the existing docker image (eg. |
| 18 | + humble) |
| 19 | + type: string |
| 20 | + default: humble |
| 21 | + target_release: |
| 22 | + description: In case of "stable" release specify the version of the existing docker image (eg. |
| 23 | + 1.0.12) |
| 24 | + type: string |
| 25 | + default: 0.0.0 |
| 26 | + target_date: |
| 27 | + description: In case of "stable" release specify the date of the existing docker image in format |
| 28 | + YYYYMMDD (eg. 20220124) |
| 29 | + type: string |
| 30 | + default: '20131206' |
| 31 | + workflow_dispatch: |
| 32 | + inputs: |
| 33 | + build_type: |
| 34 | + description: Is it a "development" or a "stable" release? |
| 35 | + required: true |
| 36 | + type: choice |
| 37 | + default: development |
| 38 | + options: |
| 39 | + - development |
| 40 | + - stable |
| 41 | + target_distro: |
| 42 | + description: In case of "stable" release specify the ROS distro of the existing docker image (eg. |
| 43 | + humble) |
| 44 | + type: string |
| 45 | + default: humble |
| 46 | + target_release: |
| 47 | + description: In case of "stable" release specify the version of the existing docker image (eg. |
| 48 | + 1.0.12) |
| 49 | + type: string |
| 50 | + default: 0.0.0 |
| 51 | + target_date: |
| 52 | + description: In case of "stable" release specify the date of the existing docker image in format |
| 53 | + YYYYMMDD (eg. 20220124) |
| 54 | + type: string |
| 55 | + default: '20131206' |
| 56 | +jobs: |
| 57 | + build: |
| 58 | + runs-on: ubuntu-22.04 |
| 59 | + strategy: |
| 60 | + fail-fast: false |
| 61 | + matrix: |
| 62 | + include: |
| 63 | + - dockerfile: ./docker/Dockerfile.hardware |
| 64 | + platforms: [linux/amd64, linux/arm64] |
| 65 | + repo_name: rosbot |
| 66 | + ros_distro: jazzy |
| 67 | + - dockerfile: ./docker/Dockerfile.simulation |
| 68 | + platforms: linux/amd64 |
| 69 | + repo_name: rosbot-gazebo |
| 70 | + ros_distro: jazzy |
| 71 | + |
| 72 | + steps: |
| 73 | + - name: Checkout |
| 74 | + uses: actions/checkout@v4 |
| 75 | + |
| 76 | + - name: Build Docker Image |
| 77 | + uses: husarion-ci/ros-docker-img-action@v0.8 |
| 78 | + with: |
| 79 | + dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 80 | + dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }} |
| 81 | + main_branch_name: ros2 |
| 82 | + dockerfile: ${{ matrix.dockerfile }} |
| 83 | + repo_name: ${{ matrix.repo_name }} |
| 84 | + branch_name: ${{ inputs.branch_name }} |
| 85 | + build_type: ${{ inputs.build_type }} |
| 86 | + ros_distro: ${{ matrix.ros_distro }} |
| 87 | + platforms: ${{ matrix.platforms }} |
| 88 | + # variables important only for stable release |
| 89 | + target_distro: ${{ inputs.target_distro }} |
| 90 | + target_release: ${{ inputs.target_release }} |
| 91 | + target_date: ${{ inputs.target_date }} |
0 commit comments