Skip to content

Commit

Permalink
build: update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
GZTimeWalker committed Jul 23, 2022
1 parent b3a0cae commit d1d93cc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ jobs:
env:
VITE_APP_TIMESTAMP: ${{ steps.time.outputs.time }}
VITE_APP_GIT_SHA: ${{ github.sha }}
VITE_APP_GIT_NAME: ${{ github.ref_name }}
run: docker build . --file Dockerfile --tag gzctf:test
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
env:
VITE_APP_TIMESTAMP: ${{ steps.time.outputs.time }}
VITE_APP_GIT_SHA: ${{ github.sha }}
VITE_APP_GIT_NAME: ${{ github.ref_name }}
with:
accessToken: ${{ github.token }}
tag: |
Expand Down
9 changes: 5 additions & 4 deletions GZCTF/ClientApp/src/pages/About.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import LogoHeader from '../components/LogoHeader'
import WithNavBar from '../components/WithNavbar'

const About: FC = () => {
const sha = import.meta.env.VITE_APP_GIT_SHA
const tag = import.meta.env.VITE_APP_GIT_NAME
const timestamp = import.meta.env.VITE_APP_BUILD_TIMESTAMP

return (
<WithNavBar>
<Stack justify="space-between" style={{ height: 'calc(100vh - 32px)' }}>
Expand All @@ -13,10 +17,7 @@ const About: FC = () => {
</Stack>
<Text size="xs" align="center">
© 2022 GZTime
{import.meta.env.PROD &&
`#${import.meta.env.VITE_APP_GIT_SHA.substring(0, 6)} - ${
import.meta.env.VITE_APP_TIMESTAMP
}`}
{import.meta.env.PROD && `#${sha.substring(0, 6)}:${tag} - ${timestamp}`}
</Text>
</Stack>
</WithNavBar>
Expand Down
1 change: 1 addition & 0 deletions GZCTF/ClientApp/src/vite-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
interface ImportMetaEnv {
readonly VITE_APP_TIMESTAMP: string
readonly VITE_APP_GIT_SHA: string
readonly VITE_APP_GIT_NAME: string
}

interface ImportMeta {
Expand Down

0 comments on commit d1d93cc

Please sign in to comment.