-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (52 loc) · 1.83 KB
/
update-homelab.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Update Homelab Files
on:
push:
branches:
- main
workflow_dispatch:
env:
DOCKER_FILES: -f ai.yml -f monitor.yml -f network.yml -f media.yml -f utilities.yml
DOCKER_ENV: --env-file ./secrets/homelab.env
DOCKER_FLAGS: -d --remove-orphans
jobs:
deploy:
runs-on: "self-hosted"
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: LegitCamper/homelab-secrets
path: "secrets"
sparse-checkout: |
homelab.env
sparse-checkout-cone-mode: false
token: ${{ secrets.ACCESS_TOKEN }}
- name: replace domain in configs
run: |
# add any other files that need domain substituion here - for flexablity
sed -i -e 's/$DOMAIN/${{ vars.DOMAIN }}/g' ./dashy/conf.yml
- name: install docker compose for tests
uses: KengoTODA/actions-setup-docker-compose@v1
with:
version: "2.14.2"
- name: docker compose dry run
run: |
docker compose --dry-run ${{ env.DOCKER_ENV }} ${{ env.DOCKER_FILES }} up ${{ env.DOCKER_FLAGS }}
exit $?
- name: Copy folder content recursively to remote
uses: garygrossgarten/[email protected]
with:
local: ${{ github.workspace }}
remote: /home/${{ secrets.SSH_USER }}/stacks/homelab/
host: ${{ secrets.HOST }}
username: ${{ secrets.SSH_USER }}
password: ${{ secrets.PASSWORD }}
- name: multiple command
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.SSH_USER }}
password: ${{ secrets.PASSWORD }}
script: |
cd ~/stacks/homelab/
docker compose ${{ env.DOCKER_ENV }} ${{ env.DOCKER_FILES }} up ${{ env.DOCKER_FLAGS }}