Add version, hash, and environment as build variables #4

Merged
caperren merged 4 commits from staging-build into main 2025-07-09 10:14:03 +00:00
3 changed files with 15 additions and 0 deletions
Showing only changes of commit b37ee3f94c - Show all commits

View File

@@ -52,6 +52,10 @@ jobs:
gitea.perren.cloud/caperren/${{ needs.determine_version.outputs.repo_name }}:${{ needs.determine_version.outputs.repo_version_hash }}
gitea.perren.cloud/caperren/${{ needs.determine_version.outputs.repo_name }}:${{ needs.determine_version.outputs.project_version }}
gitea.perren.cloud/caperren/caperren-com:latest
build-args: |
REPO_VERSION_HASH=${{ needs.determine_version.outputs.repo_version_hash }}
PROJECT_VERSION=${{ needs.determine_version.outputs.project_version }}
BUILD_ENVIRONMENT=production
test:
runs-on: ubuntu-latest

View File

@@ -50,6 +50,10 @@ jobs:
push: true
tags: |
gitea.perren.cloud/caperren/caperren-com:latest-staging
build-args: |
REPO_VERSION_HASH=${{ needs.determine_version.outputs.repo_version_hash }}
PROJECT_VERSION=${{ needs.determine_version.outputs.project_version }}
BUILD_ENVIRONMENT=staging
test:
runs-on: ubuntu-latest

View File

@@ -12,7 +12,14 @@ FROM base AS build-deps
RUN npm install
FROM build-deps AS build
COPY . .
ARG REPO_VERSION_HASH
ARG PROJECT_VERSION
RUN echo $"REPO_VERSION_HASH=${REPO_VERSION_HASH} \n\
PROJECT_VERSION=${PROJECT_VERSION}" >> .env
RUN npm run build
FROM httpd:latest AS runtime