1+ name : Docs Build
2+
3+ on :
4+ workflow_call :
5+
6+ jobs :
7+ build_blazor :
8+ runs-on : kendo
9+
10+ permissions :
11+ id-token : write # Required by Akeyless
12+ contents : write
13+ packages : read
14+ attestations : write
15+
16+ container :
17+ image : ghcr.io/telerik/blazor-build:dev
18+ credentials :
19+ username : ${{ github.actor }}
20+ password : ${{ github.token }}
21+ options : --user 1000 --shm-size="8g"
22+
23+ env :
24+ DOTNET_CLI_TELEMETRY_OPTOUT : true
25+ DOTNET_INSTALL_DIR : ./.dotnet
26+
27+ steps :
28+ - name : Import Secrets
29+ id : import-secrets
30+ uses : LanceMcCarthy/akeyless-action@v3
31+ with :
32+ access-id : ${{ secrets.GH_AKEYLESS_ACCESS_ID }}
33+ static-secrets : |
34+ {
35+ "/WebComponents/prod/tokens/GH_TOKEN": "GH_TOKEN"
36+ }
37+ export-secrets-to-environment : false
38+
39+ - name : Clone Blazor Repository
40+ uses : actions/checkout@v4
41+ with :
42+ repository : telerik/blazor
43+ path : temp/blazor
44+ fetch-depth : " 0"
45+ ref : master
46+
47+ - name : Setup .NET
48+ uses : actions/setup-dotnet@v4
49+ with :
50+ dotnet-version : " 6.x.x"
51+
52+ - name : Setup Telerik Nuget Feeds
53+ uses : telerik/actions/setup-telerik-nuget-feeds@master
54+ with :
55+ ak-vault-token : ${{ secrets.AK_VAULT_TOKEN_PACKAGE_READER }}
56+
57+ - name : Pack Telerik.Blazor and copy docs API needed resources
58+ run : |
59+ mkdir -p BinAndXml
60+ dotnet pack blazor/Telerik.Blazor/Telerik.Blazor.csproj --configuration Release -p:IsTrial='false'
61+ cp blazor/Telerik.Blazor/bin/Release/net6.0/Telerik.Blazor.dll BinAndXml
62+ cp blazor/Telerik.Blazor/bin/Release/net6.0/Telerik.Blazor.xml BinAndXml
63+ ls BinAndXml
64+ working-directory : temp
65+
66+ - name : Get DataSource bin and xml files
67+ uses : telerik/actions/get-release-assets@master
68+ with :
69+ repo : telerik-datasource
70+ pattern : debug-assets.zip
71+ dir : temp/datasource
72+ token : ${{ steps.import-secrets.outputs.GH_TOKEN }}
73+ unzip : true
74+ verify-attestation : true
75+
76+ - name : Move DataSource bin and xml to BinAndXml folder
77+ run : |
78+ cp datasource/net6.0/Telerik.DataSource.dll BinAndXml
79+ cp datasource/net6.0/Telerik.DataSource.xml BinAndXml
80+ ls BinAndXml
81+ working-directory : temp
82+
83+ - name : Upload BinAndXml folder artifacts
84+ 85+ with :
86+ name : BinAndXml
87+ retention-days : 2
88+ path : temp/BinAndXml
89+
90+ extract-metadata :
91+ runs-on : windows-latest
92+ needs : build_blazor
93+ permissions :
94+ id-token : write # Required by Akeyless
95+ contents : write
96+ steps :
97+ - name : Import Secrets
98+ id : import-secrets
99+ uses : LanceMcCarthy/akeyless-action@v3
100+ with :
101+ access-id : ${{ secrets.GH_AKEYLESS_ACCESS_ID }}
102+ static-secrets : |
103+ {
104+ "/WebComponents/prod/tokens/GH_TOKEN": "GH_TOKEN"
105+ }
106+ export-secrets-to-environment : false
107+
108+ - name : Check out Blazor-Docs repo
109+ uses : actions/checkout@v4
110+ with :
111+ sparse-checkout : _assetsApi
112+ ref : ${{ github.ref_name }}
113+ token : ${{ steps.import-secrets.outputs.GH_TOKEN }}
114+ fetch-depth : " 0"
115+
116+ - name : Download Binaries
117+ 118+ with :
119+ name : BinAndXml
120+ path : src
121+
122+ - name : Copy docfx config files
123+ run : |
124+ copy .\_assetsApi\filterConfig.yml .\filterConfig.yml
125+ copy .\_assetsApi\metadata-config.json .\metadata-config.json
126+
127+ - name : Install docfx
128+ run : dotnet tool update -g docfx
129+
130+ - name : Generate metadata
131+ run : docfx metadata-config.json
132+
133+ - name : Zip metadata
134+ run : 7z a metadata.zip .\metadata\*
135+
136+ - name : Upload metadata artifacts
137+ 138+ with :
139+ name : metadata
140+ retention-days : 2
141+ path : .\metadata.zip
142+
143+ build-docs :
144+ needs : extract-metadata
145+ runs-on : ubuntu-latest
146+ permissions :
147+ id-token : write # Required by Akeyless
148+ contents : write
149+ steps :
150+ - name : Import Secrets
151+ id : import-secrets
152+ uses : LanceMcCarthy/akeyless-action@v3
153+ with :
154+ access-id : ${{ secrets.GH_AKEYLESS_ACCESS_ID }}
155+ static-secrets : |
156+ {
157+ "/WebComponents/prod/tokens/GH_TOKEN": "GH_TOKEN"
158+ }
159+ export-secrets-to-environment : false
160+
161+ - name : Check out Blazor-Docs repo
162+ uses : actions/checkout@v4
163+ with :
164+ ref : ${{ github.ref_name }}
165+ token : ${{ steps.import-secrets.outputs.GH_TOKEN }}
166+ fetch-depth : " 0"
167+
168+ - name : Download Api Metadata
169+ 170+ with :
171+ name : metadata
172+ path : metadata
173+
174+ - name : Extract Api Metadata
175+ run : 7z x ./metadata/metadata.zip -ometadata
176+
177+ - name : Check out docs builder repository
178+ uses : actions/checkout@v4
179+ with :
180+ repository : telerik/docs-builder
181+ ref : master
182+ path : docs-builder
183+ token : ${{ steps.import-secrets.outputs.GH_TOKEN }}
184+
185+ - name : install packages
186+ run : npm ci
187+ working-directory : docs-builder
188+
189+ - name : Build Content
190+ run : npm run prod-build --docsPath=../blazor-docs --docfxFilesPath=../metadata
191+ working-directory : docs-builder
0 commit comments