name: Deploy cloud-pc on: push: paths: - 'cloud-pc/**' jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: fetch-depth: 2 - name: Deploy changed stacks run: | ssh -o StrictHostKeyChecking=no ${{ secrets.CLOUD-PC_USER }}@${{ secrets.CLOUD-PC_HOST }} << 'ENDSSH' cd /opt/services git pull for dir in $(git diff --name-only HEAD~1 HEAD | grep '^cloud-pc/' | cut -d/ -f2 | sort -u); do echo "==> Deploying $dir" cd /opt/services/cloud-pc/$dir if grep -qE '^[[:space:]]*build:' docker-compose.yml; then docker compose up -d --build --remove-orphans else docker compose pull docker compose up -d --remove-orphans fi cd /opt/services done ENDSSH