name: Upload Code to Deepset on: push: branches: - main jobs: upload-files: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v5 with: fetch-depth: 0 # Fetch all history for proper diff - name: Set up Python uses: actions/setup-python@v6 with: python-version: '3.12' - name: Install uv run: | pip install uv - name: Get changed files id: changed-files uses: tj-actions/changed-files@v46 with: files: | haystack/**/*.py separator: ' ' - name: Upload files to Deepset if: steps.changed-files.outputs.any_changed == 'true' || steps.changed-files.outputs.any_deleted == 'true' env: DEEPSET_API_KEY: ${{ secrets.DEEPSET_API_KEY }} DEEPSET_WORKSPACE: haystack-code run: | # Combine added and modified files for upload CHANGED_FILES="" if [ -n "${{ steps.changed-files.outputs.added_files }}" ]; then CHANGED_FILES="${{ steps.changed-files.outputs.added_files }}" fi if [ -n "${{ steps.changed-files.outputs.modified_files }}" ]; then if [ -n "$CHANGED_FILES" ]; then CHANGED_FILES="$CHANGED_FILES ${{ steps.changed-files.outputs.modified_files }}" else CHANGED_FILES="${{ steps.changed-files.outputs.modified_files }}" fi fi # Run the script with changed and deleted files # shellcheck disable=SC2086 uv run --no-project --no-config --no-cache .github/utils/deepset_sync.py \ --changed $CHANGED_FILES \ --deleted ${{ steps.changed-files.outputs.deleted_files }}