From 121eef5f69b38bc0e1d44a8bc7ee02e57a1144e9 Mon Sep 17 00:00:00 2001 From: EricX-Zhao Date: Mon, 22 Jun 2026 15:02:29 +0300 Subject: [PATCH] Limit build workflow to manual dispatch only --- .github/workflows/build-images.yaml | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build-images.yaml b/.github/workflows/build-images.yaml index cbc12e5..a4688f4 100644 --- a/.github/workflows/build-images.yaml +++ b/.github/workflows/build-images.yaml @@ -1,18 +1,6 @@ name: Build Cross-Compiled ROS 2 Images on: - push: - branches: [main] - paths-ignore: - - "**.md" - - ".github/ISSUE_TEMPLATE/**" - - ".github/pull_request_template.md" - pull_request: - branches: [main] - paths-ignore: - - "**.md" - - ".github/ISSUE_TEMPLATE/**" - - ".github/pull_request_template.md" workflow_dispatch: inputs: platform: @@ -42,8 +30,8 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - platform: ${{ github.event_name == 'workflow_dispatch' && fromJSON(format('["{0}"]', inputs.platform)) || fromJSON('["rk3588"]') }} - ros_distro: ${{ github.event_name == 'workflow_dispatch' && fromJSON(format('["{0}"]', inputs.ros_distro)) || fromJSON('["rolling"]') }} + platform: ${{ fromJSON(format('["{0}"]', inputs.platform)) }} + ros_distro: ${{ fromJSON(format('["{0}"]', inputs.ros_distro)) }} fail-fast: false steps: @@ -57,7 +45,7 @@ jobs: network=host - name: Log in to GitHub Container Registry - if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.push_images) + if: inputs.push_images uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} @@ -70,7 +58,7 @@ jobs: docker compose -f cross_compile/compose.yaml build cc-base - name: Push cc-base - if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.push_images) + if: inputs.push_images run: | docker tag cc-base:latest \ ${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/cc-base:latest @@ -84,7 +72,7 @@ jobs: BUILDKIT_INLINE_CACHE: "1" - name: Push cc-toolchain - if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.push_images) + if: inputs.push_images run: | docker tag ${{ matrix.platform }}/cc-toolchain:latest \ ${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${{ matrix.platform }}/cc-toolchain:latest @@ -98,7 +86,7 @@ jobs: BUILDKIT_INLINE_CACHE: "1" - name: Push vendor-packages - if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.push_images) + if: inputs.push_images run: | docker tag ${{ matrix.platform }}/cc-vendor-packages:latest \ ${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${{ matrix.platform }}/cc-vendor-packages:latest @@ -112,7 +100,7 @@ jobs: BUILDKIT_INLINE_CACHE: "1" - name: Push ROS 2 image - if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.push_images) + if: inputs.push_images run: | docker tag ${{ matrix.platform }}/cc-ros-${{ matrix.ros_distro }}:latest \ ${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${{ matrix.platform }}/cc-ros-${{ matrix.ros_distro }}:latest