1
+ name : Daily Build Embeddings
2
+
3
+ env :
4
+ DIFFUSERS_SLOW_IMPORT : yes
5
+
6
+ on :
7
+ push :
8
+ schedule :
9
+ - cron : " 5 7 * * *" # every day at 07:05
10
+ # to run this workflow manually from the Actions tab
11
+ workflow_dispatch :
12
+
13
+ # Steps
14
+ # for i in list:
15
+ # git clone
16
+ # install
17
+ # build embeddings
18
+
19
+ jobs :
20
+ matrix-job :
21
+ runs-on : ubuntu-latest
22
+ container : huggingface/transformers-doc-builder
23
+ strategy :
24
+ max-parallel : 1 # run the matrix jobs sequentially
25
+ matrix :
26
+ include :
27
+ - repo_id : huggingface/diffusers
28
+ doc_folder : docs/source/en
29
+ concurrency :
30
+ group : ${{ github.workflow }}-${{ github.ref }}
31
+ cancel-in-progress : true
32
+ timeout-minutes : 360 # Set timeout to 6 hours
33
+ steps :
34
+ - name : Setup REPO_NAME
35
+ shell : bash
36
+ run : |
37
+ current_path=$(pwd)
38
+ repo_id="${{ matrix.repo_id }}"
39
+ repo_name="${repo_id#*/}"
40
+ echo "REPO_NAME=${repo_name}" >> $GITHUB_ENV
41
+
42
+ - name : Checkout repository
43
+ uses : actions/checkout@v2
44
+ with :
45
+ repository : ${{ matrix.repo_id }}
46
+ path : ${{ github.workspace }}/${{ env.REPO_NAME }}
47
+
48
+ - name : Install libgl1
49
+ run : apt-get install -y libgl1
50
+
51
+ - name : Setup environment
52
+ shell : bash
53
+ run : |
54
+ current_path=$(pwd)
55
+
56
+ python -V
57
+
58
+ cd ${{ env.REPO_NAME }}
59
+ pip install .[dev]
60
+
61
+ cd $current_path
62
+
63
+ rm -rf doc-builder
64
+ rm -rf .git
65
+ git clone https://github.com/huggingface/doc-builder.git
66
+ cd doc-builder
67
+ git fetch
68
+ git checkout build_embeddings
69
+ pip install .
70
+
71
+ - name : Build embeddings
72
+ shell : bash
73
+ run : |
74
+ doc-builder embeddings ${{ env.REPO_NAME }} ${{ env.REPO_NAME }}/${{ matrix.doc_folder }}
75
+
76
+
77
+ cleanup-job :
78
+ needs : matrix-job
79
+ runs-on : ubuntu-latest
80
+ steps :
81
+ - name : Run cleanup steps
82
+ run : |
83
+ echo "Performing cleanup tasks"
84
+ # Add your cleanup commands here
0 commit comments