File tree 2 files changed +34
-23
lines changed
2 files changed +34
-23
lines changed Original file line number Diff line number Diff line change @@ -36,71 +36,82 @@ jobs:
36
36
shell : bash
37
37
run : |
38
38
IFS=' ' read -r -a folder_array <<< "${{ steps.detect-changes.outputs.folders }}"
39
+ hosts=""
40
+ folders=""
41
+
39
42
for folder in "${folder_array[@]}"; do
40
43
case $folder in
41
44
actual)
42
- target_host ="ubu.lan"
45
+ host ="ubu.lan"
43
46
;;
44
47
arrs)
45
- target_host ="arrs.lan"
48
+ host ="arrs.lan"
46
49
;;
47
50
arm)
48
- target_host ="arm.lan"
51
+ host ="arm.lan"
49
52
;;
50
53
AI)
51
- target_host ="ai.lan"
54
+ host ="ai.lan"
52
55
;;
53
56
authentik)
54
- target_host ="auth.lan"
57
+ host ="auth.lan"
55
58
;;
56
59
ag-main)
57
- target_host ="dns.lan"
60
+ host ="dns.lan"
58
61
;;
59
62
exporters)
60
- target_host ="all"
63
+ host ="all"
61
64
;;
62
65
grafana)
63
- target_host ="ubu.lan"
66
+ host ="ubu.lan"
64
67
;;
65
68
jellyfin)
66
- target_host ="jf.lan"
69
+ host ="jf.lan"
67
70
;;
68
71
kasm)
69
- target_host ="kasm.lan"
72
+ host ="kasm.lan"
70
73
;;
71
74
netboot)
72
- target_host ="netboot.lan"
75
+ host ="netboot.lan"
73
76
;;
74
77
nexterm)
75
- target_host ="ubu.lan"
78
+ host ="ubu.lan"
76
79
;;
77
80
npm)
78
- target_host ="npm.lan"
81
+ host ="npm.lan"
79
82
;;
80
83
plex)
81
- target_host ="plex.lan"
84
+ host ="plex.lan"
82
85
;;
83
86
paperless)
84
- target_host ="ubu.lan"
87
+ host ="ubu.lan"
85
88
;;
86
89
portainer)
87
- target_host ="port.lan"
90
+ host ="port.lan"
88
91
;;
89
92
runner)
90
- target_host ="runner.lan"
93
+ host ="runner.lan"
91
94
;;
92
- # Add cases for other folders/hosts
93
95
*)
94
96
echo "Unknown folder: $folder"
95
97
exit 1
96
98
;;
97
99
esac
98
- echo "Deploying to $target_host for folder $folder"
99
100
100
- echo "target_host=$target_host" >> $GITHUB_ENV
101
- echo "folder=$folder" >> $GITHUB_ENV
101
+ if [ -z "$hosts" ]; then
102
+ hosts="$host"
103
+ folders="$folder"
104
+ else
105
+ hosts="$hosts,$host"
106
+ folders="$folders,$folder"
107
+ fi
102
108
done
103
109
110
+ echo "Deploying to hosts: $hosts for folders: $folders"
111
+
112
+ echo "target_host=$hosts" >> $GITHUB_ENV
113
+ echo "folder=$folders" >> $GITHUB_ENV
114
+
104
115
- name : Get Secrets from Bitwarden
105
116
id : bitwarden-secrets
106
117
uses : https://github.com/bitwarden/sm-action@v2
Original file line number Diff line number Diff line change 1
1
- name : Deploy application
2
- hosts : " {{ target_host }}"
2
+ hosts : " {{ target_host.split(',') | join(',') }}"
3
3
vars :
4
- repo_path : " /home/{{ ansible_user }}/iac/docker/{{ folder }}"
4
+ repo_path : " /home/{{ ansible_user }}/iac/docker/{{ folder.split(',') | join(',') }}"
5
5
secrets_mapping_file : " /home/{{ ansible_user }}/iac/docker/secret-mappings.yml"
6
6
tasks :
7
7
- name : Ensure the repository is up-to-date
You can’t perform that action at this time.
0 commit comments