Limit build workflow to manual dispatch only

This commit is contained in:
EricX-Zhao
2026-06-22 15:02:29 +03:00
parent 1d9a214fd6
commit 121eef5f69
+7 -19
View File
@@ -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