File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33 push :
44 branches :
55 - main
6+ # Publish semver tags as releases
7+ tags : [ '*.*.*' ]
68 pull_request :
79jobs :
810 test :
Original file line number Diff line number Diff line change @@ -67,14 +67,26 @@ jobs:
6767 with :
6868 images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
6969
70+ # Extract version from tag if this is a tag push
71+ - name : Extract version from tag
72+ id : get_version
73+ if : startsWith(github.ref, 'refs/tags/')
74+ run : |
75+ VERSION=${GITHUB_REF#refs/tags/}
76+ VERSION=${VERSION#v}
77+ echo "version=$VERSION" >> $GITHUB_OUTPUT
78+ echo "Release version: $VERSION"
79+
7080 # Build and push Docker image with Buildx (don't push on PR)
7181 # https://github.com/docker/build-push-action
7282 - name : Build and push Docker image
7383 id : build-and-push
7484 uses : docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
7585 with :
7686 context : .
77- build-args : SAAS=1
87+ build-args : |
88+ SAAS=1
89+ ${{ startsWith(github.ref, 'refs/tags/') && format('VERSION={0}', steps.get_version.outputs.version) || '' }}
7890 push : ${{ github.event_name != 'pull_request' }}
7991 tags : ${{ steps.meta.outputs.tags }}
8092 labels : ${{ steps.meta.outputs.labels }}
Original file line number Diff line number Diff line change 11FROM node:22-slim AS front_builder
2+ ARG VERSION
3+ ARG SAAS
24SHELL ["/bin/bash" , "-c" ]
35WORKDIR /app/frontend
46COPY frontend/package.json frontend/yarn.lock frontend/angular.json frontend/tsconfig.app.json frontend/tsconfig.json /app/frontend/
@@ -7,8 +9,17 @@ RUN apt-get update && apt-get install -y \
79 git \
810 && rm -rf /var/lib/apt/lists/*
911RUN yarn install --immutable --network-timeout 1000000 --silent
12+ COPY frontend/scripts /app/frontend/scripts
1013COPY frontend/src /app/frontend/src
11- ARG SAAS
14+
15+ # Update version if VERSION build arg is provided
16+ RUN if [[ -n $VERSION ]]; then \
17+ cd frontend; \
18+ echo "Updating package.json version to $VERSION" && \
19+ npm version $VERSION --no-git-tag-version && \
20+ yarn update-version; \
21+ fi
22+
1223RUN if [[ -n $SAAS ]]; then API_ROOT=/api yarn build --configuration=saas-production; \
1324 else API_ROOT=/api yarn build --configuration=production; fi
1425RUN ls /app/frontend/dist/dissendium-v0
@@ -21,7 +32,7 @@ RUN apt-get update && apt-get install -y \
2132 tini nginx \
2233 make gcc g++ python3 \
2334 libxml2 \
24- && rm -rf /var/lib/apt/lists/*
35+ && rm -rf /var/lib/apt/lists/*
2536
2637WORKDIR /app
2738COPY package.json .yarnrc.yml yarn.lock /app/
You can’t perform that action at this time.
0 commit comments