Merge pull request #1041 from davydehaas98/renovate/ghcr.io-koenkk-zi… #175
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy home-stack | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- "home-stack/**" | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: false | |
env: | |
TARGET_DIR: /home/homelab/compose/home-stack | |
jobs: | |
deploy: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- 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: Copy 'compose.*.yaml' files | |
run: | | |
rsync --archive --verbose --delete --exclude '*.env' \ | |
--recursive ./home-stack/enabled/ \ | |
homelab@${{ secrets.SSH_HOST }}:${{ env.TARGET_DIR }} | |
- name: Start containers | |
run: | | |
ssh homelab@${{ secrets.SSH_HOST }} /bin/bash << ENDSSH | |
cd ${{ env.TARGET_DIR }} | |
for filename in compose.*.yaml; do | |
args="\$args -f \$filename"; | |
done; | |
echo \$args | |
docker compose \$args up -d --remove-orphans | |
ENDSSH |