Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add build timestamp information #389

Merged
merged 2 commits into from
Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,14 @@ jobs:
env:
DOCKER_METADATA_PR_HEAD_SHA: true

- name: get date
run: echo "BUILD_TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_ENV

- uses: docker/build-push-action@v4
with:
build-args: |
VITE_APP_GIT_SHA=${{ github.event_name == 'push' && github.sha || github.event.pull_request.head.sha }}
VITE_APP_BUILD_TIMESTAMP=${{ env.BUILD_TIMESTAMP }}
SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_RELEASE=${{ github.event_name == 'push' && github.sha || github.event.pull_request.head.sha }}
builder: ${{ steps.buildx.outputs.name }}
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ ADD . ./
RUN pnpm install --offline

ARG VITE_APP_GIT_SHA=unknown
ARG VITE_APP_BUILD_TIMESTAMP=1970-01-01T00:00:00Z
ARG SENTRY_AUTH_TOKEN
ARG SENTRY_RELEASE
ENV VITE_APP_GIT_SHA $VITE_APP_GIT_SHA
ENV VITE_APP_BUILD_TIMESTAMP $VITE_APP_BUILD_TIMESTAMP
ENV SENTRY_AUTH_TOKEN $SENTRY_AUTH_TOKEN
ENV SENTRY_RELEASE $SENTRY_RELEASE
RUN pnpm build:production
Expand Down
1 change: 1 addition & 0 deletions src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ if (window.SENTRY_ENV) {

console.info('Mode:', import.meta.env.MODE || 'unknown');
console.info('App version:', import.meta.env.VITE_APP_GIT_SHA || 'dev');
console.info('Build timestamp:', import.meta.env.VITE_APP_BUILD_TIMESTAMP || 'unknown');

ReactDOM.createRoot(document.getElementById('root')).render((
<MuiThemeProvider theme={Theme}>
Expand Down