-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (49 loc) · 1.63 KB
/
main.yaml
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
name: Main
on:
push:
branches:
- main
concurrency:
group: ${{ github.ref }}
cancel-in-progress: false
env:
UID: 1400
GID: 1400
TZ: Etc/UTC
STORAGE_DIR: /mnt/raid/home-server
TARGET_DIR: /home/homelab/compose/home-server
USER_DIR: /home/homelab/home-server
DOMAIN_NAME: davydehaas.nl
jobs:
deploy:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- name: Setup SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts
- name: SCP | Copy files
run: |
scp -r ./enabled/docker-compose.*.yaml ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }}:${{ env.TARGET_DIR }}
- name: SSH | Start containers
run: |
ssh homelab@${{ secrets.SSH_HOST }} /bin/bash <<- ENDSSH
cd ${{ env.TARGET_DIR }}
cat <<- EOF > .env
UID=${{ env.UID }}
GID=${{ env.GID }}
TZ=${{ env.TZ }}
STORAGE_DIR=${{ env.STORAGE_DIR }}
USER_DIR=${{ env.USER_DIR }}
DOMAIN_NAME=${{ env.DOMAIN_NAME }}
FOUNDRY_USERNAME=${{ secrets.FOUNDRY_USERNAME }}
FOUNDRY_PASSWORD=${{ secrets.FOUNDRY_PASSWORD }}
RENOVATE_TOKEN=${{ secrets.RENOVATE_TOKEN }}
WEBHOOK_DIUN=${{ secrets.WEBHOOK_DIUN }}
WEBHOOK_PROMETHEUS=${{ secrets.WEBHOOK_PROMETHEUS }}
EOF
ENDSSH