# woodpecker.custom.yml
steps:

  # 🚀 Déploiement pour le projet concerné
  - name: Deploy vmx-paperless-appdata
    image: alpine
    environment:
      SSH_PRIVATE_KEY:
        from_secret: DEPLOY_SSH_KEY
      DEPLOY_PATH:
        from_secret: DEPLOY_PATH
      DEPLOY_HOST:
        from_secret: DEPLOY_HOST
      DEPLOY_USER:
        from_secret: DEPLOY_USER
      DEPLOY_BRANCH:
        from_secret: DEPLOY_BRANCH
    commands:
      - echo "🚀 Deploying project $CI_REPO_NAME to $DEPLOY_HOST..."
      - |
        ssh "$DEPLOY_USER@$DEPLOY_HOST" "
          set -e
          cd \"$DEPLOY_PATH\" &&
          git fetch origin &&
          git reset --hard origin/$DEPLOY_BRANCH &&
          git clean -fd
        "
