Merge pull request #1033 from davydehaas98/renovate/docker.io-traefik… #21
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 reverse-proxy-stack | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'reverse-proxy-stack/**' | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: false | |
env: | |
TARGET_DIR: /home/homelab/compose/reverse-proxy-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 ./reverse-proxy-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; | |
docker compose \$args up -d --remove-orphans | |
ENDSSH |