Skip to content

deploy_workflow

deploy_workflow #1115

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@v2-beta
- uses: actions/upload-artifact@v2
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,
dynamixel_hardware_interface,
geographic_conversion,
geographic_info,
hermite_path_planner,
hungarian_solver,
image_processing_utils,
joy_to_twist,
lidar_camera_fusion,
lua_vendor,
message_synchronizer,
miniv_control,
miniv_description,
navi_sim,
nmea_gps_driver,
nmea_hardware_interface,
nmea_to_geopose,
odom_frame_publisher,
ouxt_common,
pcl_apps,
perception_bringup,
perception_camera_driver,
perception_msgs,
perception_server,
playstation_controller_drivers,
quaternion_operation,
robotx_behavior_tree,
robotx_communication,
robotx_costmap_calculator,
robotx_ekf,
robotx_planner_bringup,
ros_kvh1750,
scan_segmentation,
sol_vendor,
tcp_sender,
usv_controller,
vision_opencv,
wamv_control,
wamv_description,
]
steps:
- uses: actions/download-artifact@v2
with:
name: templates
path: ~/templates
- uses: actions/checkout@v2
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 "::set-output name=exist::$(git ls-remote --heads https://github.com/OUXT-Polaris/${{ matrix.package_name }}.git workflow/sync | wc -l)"
- name: Count changes
id: changes
run: |
git add -N .
echo "::set-output name=count::$(git diff --name-only | wc -l)"
- name: Check default branch
id: check_default_branch
run: |
echo "::set-output name=default_branch::$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')"
- 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