Quietly embed version to homepage

This commit is contained in:
2025-04-07 15:08:07 -04:00
parent 0283c293ef
commit d144f7385b
4 changed files with 22 additions and 10 deletions

View File

@ -22,7 +22,7 @@ jobs:
- name: Build & Tag Image - name: Build & Tag Image
run: | run: |
docker build -t git.altaiar.dev/${{ gitea.repository }}:${{ gitea.ref_name }} . docker build --build-arg APP_VERSION=${{ gitea.ref_name }} -t git.altaiar.dev/${{ gitea.repository }}:${{ gitea.ref_name }} .
docker tag git.altaiar.dev/${{ gitea.repository }}:${{ gitea.ref_name }} git.altaiar.dev/${{ gitea.repository }}:latest docker tag git.altaiar.dev/${{ gitea.repository }}:${{ gitea.ref_name }} git.altaiar.dev/${{ gitea.repository }}:latest
- name: Push Images - name: Push Images

View File

@ -67,6 +67,7 @@ ARG CITY
ARG DEFAULT_THEME ARG DEFAULT_THEME
ARG API_ADDRESS_PROD ARG API_ADDRESS_PROD
ARG API_ADDRESS_DEV ARG API_ADDRESS_DEV
ARG APP_VERSION
COPY --chown=node:node web web COPY --chown=node:node web web
RUN yarn rw build web RUN yarn rw build web
@ -83,6 +84,7 @@ ARG CITY
ARG DEFAULT_THEME ARG DEFAULT_THEME
ARG API_ADDRESS_PROD ARG API_ADDRESS_PROD
ARG API_ADDRESS_DEV ARG API_ADDRESS_DEV
ARG APP_VERSION
COPY --chown=node:node web web COPY --chown=node:node web web
RUN yarn rw build web --no-prerender RUN yarn rw build web --no-prerender
@ -157,7 +159,8 @@ COPY --chown=node:node graphql.config.js .
COPY --chown=node:node --from=web_build /home/node/app/web/dist /home/node/app/web/dist COPY --chown=node:node --from=web_build /home/node/app/web/dist /home/node/app/web/dist
ENV NODE_ENV=production \ ENV NODE_ENV=production \
API_PROXY_TARGET=http://api:8911 API_PROXY_TARGET=http://api:8911 \
APP_VERSION=${APP_VERSION}
# We use the shell form here for variable expansion. # We use the shell form here for variable expansion.
CMD "node_modules/.bin/rw-web-server" "--api-proxy-target" "$API_PROXY_TARGET" CMD "node_modules/.bin/rw-web-server" "--api-proxy-target" "$API_PROXY_TARGET"

View File

@ -9,7 +9,7 @@
title = "${FIRST_NAME} ${LAST_NAME}" title = "${FIRST_NAME} ${LAST_NAME}"
port = 8910 port = 8910
apiUrl = "/api" apiUrl = "/api"
includeEnvironmentVariables = ["FIRST_NAME", "LAST_NAME", "COUNTRY", "STATE", "CITY", "DEFAULT_THEME", "API_ADDRESS_PROD", "API_ADDRESS_DEV"] includeEnvironmentVariables = ["FIRST_NAME", "LAST_NAME", "COUNTRY", "STATE", "CITY", "DEFAULT_THEME", "API_ADDRESS_PROD", "API_ADDRESS_DEV", "APP_VERSION"]
[generate] [generate]
tests = false tests = false
stories = false stories = false

View File

@ -65,14 +65,23 @@ const HomePage = () => (
</div> </div>
</div> </div>
<div className="fixed bottom-2 left-2 z-10"> <div className="fixed bottom-2 left-2 z-10">
<a <div
href="https://git.altaiar.dev/ahmed/portfolio" className="tooltip tooltip-right"
target="_blank" data-tip={process.env.APP_VERSION || ''}
rel="noreferrer"
className="btn btn-square"
> >
{getLogoComponent('gitea')} <a
</a> href={
process.env.APP_VERSION.length > 0
? `https://git.altaiar.dev/ahmed/portfolio/releases/tag/${process.env.APP_VERSION}`
: 'https://git.altaiar.dev/ahmed/portfolio'
}
target="_blank"
rel="noreferrer"
className="btn btn-square"
>
{getLogoComponent('gitea')}
</a>
</div>
</div> </div>
</> </>
) )