77
88env :
99 AZURE_WEBAPP_NAME : static-docs-site
10+ AZURE_WEBAPP_PACKAGE_PATH : ' .'
1011 NODE_VERSION : ' 20.x'
1112
1213jobs :
@@ -22,57 +23,15 @@ jobs:
2223 node-version : ${{ env.NODE_VERSION }}
2324 cache : ' npm'
2425
25- # Cache Docusaurus build artifacts
26- - name : Cache Docusaurus build folder
27- uses : actions/cache@v4
28- with :
29- path : |
30- .docusaurus
31- node_modules/.cache
32- key : ${{ runner.os }}-docusaurus-${{ hashFiles('docs/**/*.md', 'docs/**/*.mdx', 'sidebars/**/*.js', 'docusaurus.config.js', 'package-lock.json') }}
33- restore-keys : |
34- ${{ runner.os }}-docusaurus-
35-
36- # Cache build output for unchanged content
37- - name : Restore build cache
38- id : cache-build-restore
39- uses : actions/cache/restore@v4
40- with :
41- path : build
42- key : ${{ runner.os }}-build-${{ hashFiles('docs/**', 'sidebars/**', 'src/**', 'static/**', 'docusaurus.config.js', 'package-lock.json') }}
43- restore-keys : |
44- ${{ runner.os }}-build-
45-
4626 - name : Install dependencies
4727 run : npm ci
4828
4929 - name : Build application
50- if : steps.cache-build-restore.outputs.cache-hit != 'true'
51- run : |
52- echo "No build cache found, running full build..."
53- npm run build
54- echo "Build completed!"
55-
56- - name : Skip build (using cache)
57- if : steps.cache-build-restore.outputs.cache-hit == 'true'
58- run : |
59- echo "Build cache found! Skipping build step."
60- echo "Using cached build output from previous run."
61-
62- # Save the build output before modifying it
63- - name : Save build cache
64- if : steps.cache-build-restore.outputs.cache-hit != 'true'
65- uses : actions/cache/save@v4
66- with :
67- path : build
68- key : ${{ runner.os }}-build-${{ hashFiles('docs/**', 'sidebars/**', 'src/**', 'static/**', 'docusaurus.config.js', 'package-lock.json') }}
30+ run : npm run build
6931
7032 - name : Deploy to Azure Web App
7133 uses : azure/webapps-deploy@v2
7234 with :
7335 app-name : ${{ env.AZURE_WEBAPP_NAME }}
7436 publish-profile : ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
75- package : ./build
76-
77- # Azure App Service will run "npm start" which executes "serve . -l 8080"
78- # This serves files from the current directory (where the build contents are extracted)
37+ package : ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}
0 commit comments