44 lines
1.2 KiB
YAML
44 lines
1.2 KiB
YAML
name: Sync Label Studio Annotations
|
|
|
|
on:
|
|
schedule:
|
|
# This job will run every day at 03:00 AM
|
|
- cron: "0 3 * * *"
|
|
|
|
jobs:
|
|
sync_storage:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Sync Label Studio to target storage
|
|
env:
|
|
LABEL_STUDIO_API_TOKEN: ${{ secrets.LABEL_STUDIO_API_TOKEN }}
|
|
run: |
|
|
curl -X POST \
|
|
-H "Authorization: Token $LABEL_STUDIO_API_TOKEN" \
|
|
"https://label-studio.gt-proj.com/api/storages/export/s3/1/sync"
|
|
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ vars.PYTHON_VERSION }}
|
|
|
|
- name: Install uv
|
|
run: pip install uv
|
|
|
|
- name: Install dependencies
|
|
env:
|
|
UV_LINK_MODE: copy
|
|
run: uv sync --all-extras
|
|
|
|
- name: Sync target storage to annotations
|
|
env:
|
|
MINIO_ENDPOINT: ${{ vars.MINIO_ENDPOINT }}
|
|
MINIO_ACCESS_KEY: ${{ secrets.MINIO_ACCESS_KEY }}
|
|
MINIO_SECRET_KEY: ${{ secrets.MINIO_SECRET_KEY }}
|
|
MINIO_BUCKET: ${{ vars.MINIO_BUCKET }}
|
|
run: |
|
|
uv run python scripts/sync_label_studio_annotations.py
|