Skip to content

deploy_workflow

deploy_workflow #1392

name: deploy_workflow
on:
schedule:
- cron: 0 0 * * *
workflow_dispatch:
push:
branches:
- "master"
paths:
- ./workflow_templates/**
- ./.github/workflows/deploy_workflow.yaml
jobs:
get_template:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/upload-artifact@v4
with:
name: templates
path: ./workflow_templates/*.yaml
deploy_workflow:
needs: get_template
runs-on: ubuntu-22.04
strategy:
max-parallel: 2
fail-fast: false
matrix:
package_name: [
boost_geometry_util,
color_names,
data_buffer,
detic_onnx_ros2,
geographic_conversion,
geographic_info,
grid_map_type_adapter,
hermite_path_planner,
hungarian_solver,
image_processing_utils,
joy_to_twist,
lidar_camera_fusion,
lua_vendor,
message_synchronizer,
navi_sim,
nmea_hardware_interface,
nmea_to_geopose,
odom_frame_publisher,
ouxt_common,
pcl_apps,
pcl_type_adapter,
perception_bringup,
perception_msgs,
perception_server,
playstation_controller_drivers,
point_painting,
prometheus_ros,
protolink,
quaternion_operation,
robotx_behavior_tree,
robotx_communication,
robotx_costmap_calculator,
robotx_ekf,
robotx_planner_bringup,
scan_segmentation,
sol_vendor,
tcp_sender,
usv_controller,
vision_opencv,
wamv_control,
wamv_description,
]
steps:
- uses: actions/download-artifact@v4
with:
name: templates
path: ~/templates
- uses: actions/checkout@v4
with:
repository: OUXT-Polaris/${{ matrix.package_name }}
token: ${{ secrets.WAMV_TAN_BOT_SECRET }}
- name: Deploy build test workflow
uses: OUXT-Polaris/[email protected]
with:
template: /home/runner/templates/BuildTest.yaml
project_path: ./
parameters: "{}"
- name: Deploy release workflow
uses: OUXT-Polaris/[email protected]
with:
template: /home/runner/templates/Release.yaml
project_path: ./
parameters: "{}"
- name: Deploy update workflow status workflow
uses: OUXT-Polaris/[email protected]
with:
template: /home/runner/templates/UpdateWorkflowStatus.yaml
project_path: ./
parameters: "{}"
- name: Deploy code review workflow
uses: OUXT-Polaris/[email protected]
with:
template: /home/runner/templates/Review.yaml
project_path: ./
parameters: "{}"
- name: Check branch exist
id: check_branch
run: |
echo "name=exist::$(git ls-remote --heads https://github.com/OUXT-Polaris/${{ matrix.package_name }}.git workflow/sync | wc -l)" >> "$GITHUB_OUTPUT"
- name: Count changes
id: changes
run: |
git add -N .
echo "name=count::$(git diff --name-only | wc -l)" >> "$GITHUB_OUTPUT"
- name: Check default branch
id: check_default_branch
run: |
echo "name=default_branch::$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')" >> "$GITHUB_OUTPUT"
- name: Delete old branch
if: steps.check_branch.outputs.exist == 1
run: |
git push origin --delete workflow/sync; exit 0
- name: Print deleted branch
if: steps.check_branch.outputs.exist == 1
run: "echo 'Deleted branches: ${{ steps.delete_stuff.outputs.deleted_branches }}'"
- uses: peter-evans/create-pull-request@v3
id: create_pull_request
if: steps.changes.outputs.count > 0
with:
token: ${{ secrets.WAMV_TAN_BOT_SECRET }}
commit-message: Setup workflow
committer: wam-v-tan <[email protected]>
author: wam-v-tan <[email protected]>
signoff: false
branch: workflow/sync
base: ${{ steps.check_default_branch.outputs.default_branch }}
delete-branch: true
title: '[Bot] Update workflow'
body: |
# Description
Setup Build test workflow
# How to check
Please check passing all CI test.
labels: |
bot
assignees: wam-v-tan
reviewers: wam-v-tan
team-reviewers: |
bot
draft: false