Skip to content

Commit 7f5d89a

Browse files
dtinthClaude
and
Claude
committed
Add app revision to service
- Display APP_REVISION in root route - Add APP_REVISION as build arg in Dockerfile - Pass git SHA as APP_REVISION in GitHub workflow 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 32ea031 commit 7f5d89a

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

.github/workflows/docker.yml

+2
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,7 @@ jobs:
4040
push: ${{ github.event_name != 'pull_request' }}
4141
tags: ${{ steps.meta.outputs.tags }}
4242
labels: ${{ steps.meta.outputs.labels }}
43+
build-args: |
44+
APP_REVISION=${{ github.sha }}
4345
cache-from: type=gha
4446
cache-to: type=gha,mode=max

service/Dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,9 @@ COPY package.json pnpm-lock.yaml ./
44
RUN corepack enable && pnpm install --frozen-lockfile
55
COPY . .
66
ENV NODE_ENV=production
7+
8+
ARG APP_REVISION=unknown
9+
ENV APP_REVISION=${APP_REVISION}
10+
711
CMD ["pnpm", "start"]
812
EXPOSE 29691

service/src/main.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const line = new Elysia()
3838

3939
const app = new Elysia({ adapter: node() })
4040
.use(createLogger())
41-
.get('/', () => 'i am automatron')
41+
.get('/', () => `i am automatron (revision: ${process.env.APP_REVISION || 'unknown'})`)
4242
.get('/recipient', () => getRecipient())
4343
.get('/config', async () => {
4444
console.log(await config.get('test'))

0 commit comments

Comments
 (0)