File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5555 run : mkdir -p website/data/cache
5656 - name : Build container
5757 run : |
58+ VERSION="${GITHUB_SHA::12}"
5859 RUN_KIND="${{ github.event_name }}"
5960 case "$RUN_KIND" in
6061 workflow_dispatch|schedule)
7778 --local context=. \
7879 --local dockerfile=container \
7980 --opt build-arg:GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} \
81+ --opt build-arg:ASSET_VERSION="$VERSION" \
8082 $PARAMS \
8183 --output type=local,dest=build-output
8284 # The local exporter writes the final image filesystem; our website
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ WORKDIR /workspace
44
55COPY . .
66
7- ARG GITHUB_TOKEN WIKI_FILE
7+ ARG GITHUB_TOKEN WIKI_FILE ASSET_VERSION
88
99RUN <<EOF
1010set -e
@@ -13,6 +13,11 @@ git log -1
1313export GITHUB_TOKEN="${GITHUB_TOKEN}"
1414npm clean-install
1515node --run all
16+
17+ # Replace cache-busting placeholder with the current commit SHA for deployed assets.
18+ ASSET_VERSION="${ASSET_VERSION:-dev}"
19+ find website -type f \( -name "*.html" -o -name "*.js" -o -name "*.css" \) \
20+ -exec sed -i "s/__ASSET_VERSION__/${ASSET_VERSION}/g" {} +
1621EOF
1722
1823FROM nginxinc/nginx-unprivileged:alpine-slim
Original file line number Diff line number Diff line change 1- import { openHintsDialog } from "./hints-dialog.js" ;
1+ import { openHintsDialog } from "./hints-dialog.js?v=__ASSET_VERSION__ " ;
22
33const cardTemplate = document . getElementById ( "card-template" ) ;
44
Original file line number Diff line number Diff line change 55 < meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
66 < title > MagicMirror² 3rd Party Modules</ title >
77 < link rel ="icon " type ="image/x-icon " href ="favicon.svg " />
8- < link rel ="stylesheet " href ="index.css " />
8+ < link rel ="stylesheet " href ="index.css?v=__ASSET_VERSION__ " />
99 < link
1010 rel ="stylesheet "
1111 href ="fonts/line-awesome-1.3.0/css/line-awesome.min.css "
@@ -196,6 +196,6 @@ <h3 id="hints-dialog-title"></h3>
196196 </ div >
197197 </ dialog >
198198
199- < script src ="script.js " type ="module "> </ script >
199+ < script src ="script.js?v=__ASSET_VERSION__ " type ="module "> </ script >
200200 </ body >
201201</ html >
Original file line number Diff line number Diff line change 33 < head >
44 < title > Result of the module analysis</ title >
55 < link rel ="icon " type ="image/x-icon " href ="favicon.svg " />
6- < link rel ="stylesheet " href ="result.css " />
6+ < link rel ="stylesheet " href ="result.css?v=__ASSET_VERSION__ " />
77 < script src ="https://cdn.jsdelivr.net/npm/marked/marked.min.js "> </ script >
88 </ head >
99 < body >
Original file line number Diff line number Diff line change 1- import { createCard } from "./card.js" ;
1+ import { createCard } from "./card.js?v=__ASSET_VERSION__ " ;
22
33let allModules = [ ] ;
44let skippedModules = [ ] ;
You can’t perform that action at this time.
0 commit comments