haystack/.github/workflows/sync_code_to_deepset.yml
mathislucka 101e9cdc34
docs: sync code to deepset workspace (#9555)
* docs: sync code to deepset workspace

* fix: naming

* fix: actionlint
2025-06-27 07:51:59 +02:00

55 lines
1.7 KiB
YAML

name: Upload Code to Deepset
on:
push:
branches:
- main
jobs:
upload-files:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for proper diff
- name: Set up Python
uses: actions/setup-python@v5
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
uv run --no-project --no-config --no-cache .github/utils/deepset_sync.py \
--changed "$CHANGED_FILES" \
--deleted "${{ steps.changed-files.outputs.deleted_files }}"