Skip to content
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
2 changes: 2 additions & 0 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ on:
push:
branches:
- main
# Publish semver tags as releases
tags: [ '*.*.*' ]
pull_request:
jobs:
test:
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/saas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,26 @@ jobs:
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

# Extract version from tag if this is a tag push
- name: Extract version from tag
id: get_version
if: startsWith(github.ref, 'refs/tags/')
run: |
VERSION=${GITHUB_REF#refs/tags/}
VERSION=${VERSION#v}
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Release version: $VERSION"

# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
with:
context: .
build-args: SAAS=1
build-args: |
SAAS=1
${{ startsWith(github.ref, 'refs/tags/') && format('VERSION={0}', steps.get_version.outputs.version) || '' }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down
15 changes: 13 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM node:22-slim AS front_builder
ARG VERSION
ARG SAAS
SHELL ["/bin/bash", "-c"]
WORKDIR /app/frontend
COPY frontend/package.json frontend/yarn.lock frontend/angular.json frontend/tsconfig.app.json frontend/tsconfig.json /app/frontend/
Expand All @@ -7,8 +9,17 @@ RUN apt-get update && apt-get install -y \
git \
&& rm -rf /var/lib/apt/lists/*
RUN yarn install --immutable --network-timeout 1000000 --silent
COPY frontend/scripts /app/frontend/scripts
COPY frontend/src /app/frontend/src
ARG SAAS

# Update version if VERSION build arg is provided
RUN if [[ -n $VERSION ]]; then \
cd frontend; \
echo "Updating package.json version to $VERSION" && \
npm version $VERSION --no-git-tag-version && \
yarn update-version; \
fi

RUN if [[ -n $SAAS ]]; then API_ROOT=/api yarn build --configuration=saas-production; \
else API_ROOT=/api yarn build --configuration=production; fi
RUN ls /app/frontend/dist/dissendium-v0
Expand All @@ -21,7 +32,7 @@ RUN apt-get update && apt-get install -y \
tini nginx \
make gcc g++ python3 \
libxml2 \
&& rm -rf /var/lib/apt/lists/*
&& rm -rf /var/lib/apt/lists/*

WORKDIR /app
COPY package.json .yarnrc.yml yarn.lock /app/
Expand Down
Loading