Docker Images CI #530
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: Docker Images CI | |
| on: | |
| schedule: | |
| - cron: "0 4 * * 1-5" | |
| workflow_dispatch: | |
| jobs: | |
| build-tour-docker: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| config: | |
| - { | |
| ros2_distro: "jazzy", | |
| base_image_repo: "ghcr.io/hsp-iit/r1images", | |
| base_image_tag: "tourCore2_ubuntu_24.04_qt_6.8.3_jazzy", | |
| image_name_base: "ste93/convince:tour_ubuntu_24.04_qt_6.8.3_jazzy_bt", | |
| dockerfile: "Dockerfile.bt" | |
| } | |
| - { | |
| ros2_distro: "jazzy", | |
| base_image_repo: "ghcr.io/hsp-iit/r1images", | |
| base_image_tag: "tourSim2_ubuntu_24.04_qt_6.8.3_jazzy", | |
| image_name_base: "ste93/convince:tour_sim_ubuntu_24.04_qt_6.8.3_jazzy_bt", | |
| dockerfile: "Dockerfile.bt" | |
| } | |
| - { | |
| ros2_distro: "jazzy", | |
| base_image_repo: "ghcr.io/hsp-iit/r1images", | |
| base_image_tag: "tourCore2_ubuntu_24.04_qt_6.8.3_jazzy", | |
| image_name_base: "ste93/convince:tour_ubuntu_24.04_qt_6.8.3_jazzy_verification", | |
| dockerfile: "Dockerfile.verification" | |
| } | |
| steps: | |
| - name: Info | |
| run: | | |
| echo "Event type: ${{github.event_name}}" | |
| - name: Change docker to experimental mode | |
| run: | | |
| sudo rm -rf /etc/docker/daemon.json | |
| echo '{"experimental": true}' | sudo tee -a /etc/docker/daemon.json | |
| - name: Restart docker daemon | |
| run: sudo systemctl restart docker | |
| - uses: actions/checkout@v4 | |
| - name: Login to DockerHub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ste93 | |
| password: ${{ secrets.STE93_DOCKERHUB_TOKEN }} | |
| - name: Build the tour core Docker image | |
| working-directory: docker | |
| run: | | |
| if [ ${{ github.event_name }} == 'schedule' ]; then | |
| echo "Building development tour core image" | |
| sudo docker build --build-arg base_img=${{matrix.config.base_image_repo}}:${{matrix.config.base_image_tag}}_devel -t ${{matrix.config.image_name_base}}_devel -f ${{matrix.config.dockerfile}} . | |
| elif [ ${{ github.event_name }} == 'workflow_dispatch' ]; then | |
| echo "Building stable tour core image" | |
| echo $PWD | |
| sudo docker build --build-arg base_img=${{matrix.config.base_image_repo}}:${{matrix.config.base_image_tag}}_stable -t ${{matrix.config.image_name_base}}_stable -f ${{matrix.config.dockerfile}} . | |
| else | |
| echo "Failure!" | |
| exit 1 | |
| fi | |
| - name: Push tourCore2 image | |
| working-directory: docker | |
| run: | | |
| if [ ${{ github.event_name }} == 'schedule' ]; then | |
| echo "Pushing tourCore2 development image" | |
| docker push ${{matrix.config.image_name_base}}_devel | |
| elif [ ${{ github.event_name }} == 'workflow_dispatch' ]; then | |
| echo "Pushing tourCore2 stable image" | |
| docker push ${{matrix.config.image_name_base}}_stable | |
| else | |
| echo "Failure!" | |
| exit 1 | |
| fi |