5
5
branches :
6
6
- master
7
7
8
+ concurrency :
9
+ # Make sure only workflow run at a time for create_search_index.yml
10
+ group : ${{ github.workflow }}
11
+
8
12
jobs :
9
13
jekyll :
10
14
runs-on : ubuntu-latest
@@ -18,22 +22,57 @@ jobs:
18
22
ruby-version : 2.7
19
23
working-directory : docs
20
24
bundler-cache : true
21
- - name : Index changed posts
25
+ - name : Download artifacts
26
+ uses : dawidd6/action-download-artifact@v2
27
+ with :
28
+ github_token : ${{ secrets.GITHUB_TOKEN }}
29
+ workflow : create_search_index.yml
30
+ workflow_conclusion : success
31
+ name : jekyll-build
32
+ path : docs
33
+ if_no_artifact_found : ignore
34
+ - name : Extract artifacts
35
+ working-directory : docs
36
+ run : >
37
+ (7z x -o_site/ jekyll-content.zip
38
+ && rm jekyll-content.zip
39
+ && mv _site/.jekyll-metadata ./
40
+ && mv _site/backup-models.json ./
41
+ && mv _site/backup-benchmarking.json ./
42
+ && mv _site/backup-references.json ./)
43
+ || true
44
+ - name : Incremental build
45
+ id : incremental-build
46
+ env :
47
+ ELASTICSEARCH_URL : ${{ secrets.ELASTICSEARCH_URL }}
48
+ ELASTICSEARCH_ACCESS_TOKEN : ${{ secrets.ELASTICSEARCH_ACCESS_TOKEN }}
49
+ ELASTICSEARCH_INDEX_NAME : ${{ secrets.ELASTICSEARCH_INDEX_NAME }}
50
+ SEARCH_ORIGIN : ${{ secrets.SEARCH_ORIGIN }}
51
+ working-directory : docs
52
+ run : |
53
+ bundle exec jekyll build --incremental
54
+ continue-on-error : ${{ steps.incremental-build.outputs.require_full_build == 'true' }}
55
+ - name : Full build
56
+ id : full-build
57
+ if : ${{ steps.incremental-build.outputs.require_full_build == 'true' }}
22
58
env :
23
59
ELASTICSEARCH_URL : ${{ secrets.ELASTICSEARCH_URL }}
24
60
ELASTICSEARCH_ACCESS_TOKEN : ${{ secrets.ELASTICSEARCH_ACCESS_TOKEN }}
61
+ ELASTICSEARCH_INDEX_NAME : ${{ secrets.ELASTICSEARCH_INDEX_NAME }}
62
+ SEARCH_ORIGIN : ${{ secrets.SEARCH_ORIGIN }}
25
63
working-directory : docs
26
64
run : |
27
- git diff --name-only ${{github.event.before}}..${{github.event.after}} > changes.txt
28
- git diff --name-only ${{github.event.after}}..${{github.event.before}} >> changes.txt
29
- bundle exec jekyll build
30
- - uses : actions/setup-node@v2
65
+ rm -f .jekyll-metadata
66
+ FULL_BUILD=1 bundle exec jekyll build --incremental
67
+ - uses : actions/setup-node@v3
31
68
with :
32
- node-version : 14
69
+ node-version : 16
33
70
cache : yarn
34
71
cache-dependency-path : docs/_frontend/yarn.lock
35
72
- name : Build frontend
36
73
working-directory : docs/_frontend
74
+ env :
75
+ SEARCH_ORIGIN : ${{ secrets.SEARCH_ORIGIN }}
37
76
run : |
38
77
yarn
39
78
yarn run build
43
82
with :
44
83
github_token : ${{ secrets.GITHUB_TOKEN }}
45
84
publish_dir : ./docs/_site
85
+ - name : Zip contents for artifacts
86
+ uses : vimtor/action-zip@v1
87
+ with :
88
+ files : >
89
+ ./docs/_site/
90
+ ./docs/.jekyll-metadata
91
+ ./docs/backup-models.json
92
+ ./docs/backup-benchmarking.json
93
+ ./docs/backup-references.json
94
+ dest : jekyll-content.zip
95
+ - name : Upload artifacts
96
+ uses : actions/upload-artifact@v3
97
+ with :
98
+ name : jekyll-build
99
+ path : |
100
+ ./jekyll-content.zip
0 commit comments