Skip to content

Commit

Permalink
Add commit hash to client sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
lhvy committed Dec 23, 2024
1 parent 1e69af5 commit a9327d2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/docker-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
GOOGLE_OAUTH_CLIENT_ID=${{ secrets.GOOGLE_OAUTH_CLIENT_ID }}
SENTRY_INGEST_CLIENT=${{ secrets.SENTRY_INGEST_CLIENT }}
SENTRY_TRACE_RATE_CLIENT=${{ secrets.SENTRY_TRACE_RATE_CLIENT }}
GIT_COMMIT=${{ github.sha }}
tags: |
ghcr.io/csesoc/notangles-client:${{ github.sha }}
ghcr.io/csesoc/notangles-client:latest
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
GOOGLE_OAUTH_CLIENT_ID=${{ secrets.GOOGLE_OAUTH_CLIENT_ID }}
SENTRY_INGEST_CLIENT=${{ secrets.SENTRY_INGEST_CLIENT }}
SENTRY_TRACE_RATE_CLIENT=${{ secrets.SENTRY_TRACE_RATE_CLIENT }}
GIT_COMMIT=${{ github.sha }}
tags: |
ghcr.io/csesoc/notangles-client:${{ github.sha }}
ghcr.io/csesoc/notangles-client:latest
Expand Down Expand Up @@ -122,4 +123,4 @@ jobs:
git commit -m "feat(notangles): update images"
git push -u origin update/notangles/${{ github.sha }}
gh pr create -B migration --title "feat(notangles): update images" --body "Updates the images for the notangles deployment to commit csesoc/notangles@${{ github.sha }}." > URL
gh pr merge $(cat URL) --squash -d
gh pr merge $(cat URL) --squash -d
3 changes: 3 additions & 0 deletions client/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ ENV VITE_APP_SENTRY_TRACE_RATE_CLIENT=$SENTRY_TRACE_RATE_CLIENT
ENV VITE_APP_ENVIRONMENT=production
ENV NODE_ENV=production

ARG GIT_COMMIT
RUN if [ -n "$GIT_COMMIT" ]; then export VITE_COMMIT=$GIT_COMMIT; fi

RUN pnpm run build

FROM caddy:2.8.4-alpine
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ const Sidebar: React.FC = () => {
{!collapsed ? (
<SidebarFooterText>
<Divider />
<span>© DevSoc {new Date().getFullYear()}, v1.0.0</span>
<span>{import.meta.env.VITE_COMMIT?.substring(0, 7) ?? 'unknown commit'}</span>
</SidebarFooterText>
) : (
<CollapseButton collapsed={collapsed} onClick={() => handleCollapse(false)} toolTipTitle="Expand" />
Expand Down

0 comments on commit a9327d2

Please sign in to comment.