Display GitHub commit hash in interface
This commit is contained in:
parent
cdde359332
commit
1a626bb228
3 changed files with 8 additions and 1 deletions
1
.github/workflows/ci.yml
vendored
1
.github/workflows/ci.yml
vendored
|
@ -27,6 +27,7 @@ jobs:
|
|||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
push: true
|
||||
build-args: GITHUB_SHA
|
||||
tags: ekzhang/rustpad:latest
|
||||
|
||||
- name: Image digest
|
||||
|
|
|
@ -17,6 +17,8 @@ COPY package.json package-lock.json ./
|
|||
COPY --from=wasm /home/rust/src/rustpad-wasm/pkg rustpad-wasm/pkg
|
||||
RUN npm ci
|
||||
COPY . .
|
||||
ARG GITHUB_SHA
|
||||
ENV REACT_APP_SHA=${GITHUB_SHA}
|
||||
RUN npm run build
|
||||
|
||||
FROM scratch
|
||||
|
|
|
@ -25,6 +25,10 @@ import languages from "./languages.json";
|
|||
|
||||
set_panic_hook();
|
||||
|
||||
const version = process.env.REACT_APP_SHA
|
||||
? process.env.REACT_APP_SHA.slice(0, 7)
|
||||
: "development";
|
||||
|
||||
const id = window.location.hash.slice(1);
|
||||
const wsUri =
|
||||
(window.location.origin.startsWith("https") ? "wss://" : "ws://") +
|
||||
|
@ -201,7 +205,7 @@ function App() {
|
|||
align="center"
|
||||
>
|
||||
<Icon as={VscRemote} mb={-0.5} mr={1} />
|
||||
<Text fontSize="xs">Rustpad v0.1.0</Text>
|
||||
<Text fontSize="xs">Rustpad ({version})</Text>
|
||||
</Flex>
|
||||
</Flex>
|
||||
</Flex>
|
||||
|
|
Loading…
Add table
Reference in a new issue