-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (31 loc) · 1.05 KB
/
update-HIL.yml
File metadata and controls
41 lines (31 loc) · 1.05 KB
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
34
35
36
37
38
39
40
41
name: Update Local Script
#when the update.sh is updated in the repo it will update the copy on the server
on:
push:
branches:
- main
paths:
- "Update-Hil/update.sh"
#allows manual triggering of the workflow
workflow_dispatch:
#replaces the old update.sh with the new one in the repo
jobs:
update_script:
runs-on: self-hosted
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Replace local update.sh
run: |
NEW_SCRIPT_PATH="${{ github.workspace }}/Update-Hil/update.sh"
LOCAL_SCRIPT_PATH="$HOME/update.sh"
if [ -f "$NEW_SCRIPT_PATH" ]; then
cp "$NEW_SCRIPT_PATH" "$LOCAL_SCRIPT_PATH"
chmod +x "$LOCAL_SCRIPT_PATH"
echo "update.sh updated successfully in $HOME"
else
echo "Error: update.sh not found in repo folder 'update hil'!"
exit 1
fi
- name: Log update
run: echo "update.sh has been replaced with the latest version from the repo."