-
Notifications
You must be signed in to change notification settings - Fork 23
70 lines (63 loc) · 2.16 KB
/
import_packages.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Sync vector DB
on:
workflow_dispatch:
inputs:
enable_artifact_download:
description: 'Enable artifact download step'
type: boolean
required: false
default: true
jobs:
# This workflow contains a single job called "greet"
sync_db:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install "."
- name: Download git lfs dependencies
run: |
git lfs install
git lfs pull
- name: Download artifact
if: ${{ github.event.inputs.enable_artifact_download == 'true' }}
id: download-artifact
uses: dawidd6/action-download-artifact@v7
with:
github_token: ${{ github.token }}
workflow: ".github/workflows/import_packages.yml"
workflow_conclusion: success
name: backup_weaviate
path: /tmp/
name_is_regexp: true
skip_unpack: false
if_no_artifact_found: ignore
- name: Create folder if artifact download is not enabled
if: ${{ github.event.inputs.enable_artifact_download == 'false' }}
run: |
mkdir -p /tmp/backup_weaviate
echo "Folder ./backup_weaviate created because artifact download is disabled."
- name: Run sync
run: |
export PYTHONPATH=$PYTHONPATH:./
export BACKUP_FILESYSTEM_PATH=/tmp/backup_weaviate/
export BACKUP_FOLDER=backup
# Conditionally export the variables only if artifact download is enabled
if [ "${{ github.event.inputs.enable_artifact_download }}" == "true" ]; then
python scripts/import_packages.py
else
python scripts/import_packages.py --restore_backup False
fi
- name: 'Upload Backup Files'
uses: actions/upload-artifact@v4
with:
name: backup_weaviate
path: /tmp/backup_weaviate/backup*
retention-days: 90