Skip to content

Commit ecbbaf6

Browse files
committed
Client: added dockefile and expanded git pipeline
1 parent dffaed9 commit ecbbaf6

3 files changed

Lines changed: 58 additions & 29 deletions

File tree

.github/workflows/auto-test.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,33 @@ jobs:
4242
push: true
4343
tags: docker.io/${{ secrets.DOCKERHUB_ADMIN_USERNAME }}/seb-server-gui-auto-testing:${{ env.TAG_NAME }}
4444
build-args: VITE_SUB_PATH=${{ matrix.path_name }}
45+
46+
build-and-push-storybook:
47+
runs-on: ubuntu-latest
48+
needs: build-and-push-admin
49+
50+
steps:
51+
- name: Set env for dynamic tag
52+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
53+
run: echo "TAG_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
54+
55+
- name: Set env manual
56+
if: github.event_name == 'workflow_dispatch'
57+
run: echo "TAG_NAME=default_version" >> $GITHUB_ENV
58+
59+
- name: Checkout code
60+
uses: actions/checkout@v4.2.2
61+
62+
- name: Login to DockerHub
63+
uses: docker/login-action@v3.4.0
64+
with:
65+
username: ${{ secrets.DOCKERHUB_ADMIN_USERNAME }}
66+
password: ${{ secrets.DOCKERHUB_ADMIN_TOKEN }}
67+
68+
- name: Build and push Storybook Docker image
69+
uses: docker/build-push-action@v6.17.0
70+
with:
71+
context: .
72+
file: ./Dockerfile.storybook
73+
push: true
74+
tags: docker.io/${{ secrets.DOCKERHUB_ADMIN_USERNAME }}/seb-server-gui-storybook:${{ env.TAG_NAME }}

Dockerfile.storybook

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Build Storybook
2+
FROM node:22.2.0 AS storybook-builder
3+
WORKDIR /app/client
4+
5+
# Install dependencies
6+
COPY client/package*.json ./
7+
RUN npm install
8+
9+
# Copy the rest of the client code
10+
COPY client/ .
11+
12+
# Build static Storybook
13+
RUN npm run build-storybook
14+
15+
# Final image - serve Storybook statically
16+
FROM node:22.2.0-alpine
17+
WORKDIR /app
18+
19+
# Use a tiny static file server
20+
RUN npm install -g serve
21+
22+
# Copy built Storybook
23+
COPY --from=storybook-builder /app/client/storybook-static ./storybook-static
24+
25+
EXPOSE 6006
26+
27+
# Start Storybook static site
28+
CMD ["serve", "-s", "storybook-static", "-l", "6006"]

client/package-lock.json

Lines changed: 0 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)