-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (28 loc) · 1 KB
/
cd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: containerlab management
run-name: ${{inputs.containerlab_command}}, ${{inputs.lab_directory}} by ${{github.actor}}
on:
workflow_dispatch:
inputs:
containerlab_command:
description: 'containerlab command'
required: true
type: choice
options:
- deploy
- destroy
lab_directory:
description: 'lab directory'
required: true
type: string
jobs:
lab:
name: ${{inputs.containerlab_command}} ${{inputs.lab_directory}}
runs-on: self-hosted
steps:
- name: execute command
run: |
cd /home/containerlab/containerlabs/$CONTAINERLAB_LAB_DIR && \
sudo containerlab $CONTAINERLAB_COMMAND
env:
CONTAINERLAB_COMMAND: ${{ inputs.containerlab_command }}
CONTAINERLAB_LAB_DIR: ${{ inputs.lab_directory }}