File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6565 platforms : linux/amd64,linux/arm64
6666 tags : ${{ steps.meta.outputs.tags }}
6767 labels : ${{ steps.meta.outputs.labels }}
68- build-args : VERSION =${{ github.sha }}
68+ build-args : GIT_HASH =${{ github.sha }}
6969
7070 - name : Extract sha-* image label
7171 id : extract-sha
Original file line number Diff line number Diff line change @@ -11,4 +11,6 @@ RUN npm ci --omit=dev
1111
1212COPY src/ src/
1313
14+ ARG GIT_HASH
15+ ENV VERSION_HASH=${GIT_HASH}
1416CMD ["npm" , "start" ]
Original file line number Diff line number Diff line change @@ -35,4 +35,5 @@ export * from './http/json.js';
3535export * from './http/trailers.js' ;
3636export * from './http/error/close.js' ;
3737export * from './http/error/reset.js' ;
38- export * from './http/example-page.js' ;
38+ export * from './http/example-page.js' ;
39+ export * from './http/version.js' ;
Original file line number Diff line number Diff line change 1+ import { HttpEndpoint , HttpHandler } from '../http-index.js' ;
2+
3+ const versionHash = process . env . VERSION_HASH || 'unknown' ;
4+
5+ const matchPath = ( path : string ) => path === '/version' ;
6+
7+ const handle : HttpHandler = ( _req , res ) => {
8+ res . writeHead ( 200 , { 'content-type' : 'application/json' } ) ;
9+ res . end ( JSON . stringify ( {
10+ versionHash
11+ } ) ) ;
12+ }
13+
14+ export const versionJson : HttpEndpoint = {
15+ matchPath,
16+ handle
17+ } ;
You can’t perform that action at this time.
0 commit comments