Skip to content

Commit 68f4f4c

Browse files
author
abrulic
committed
deployment fix?
1 parent 770059c commit 68f4f4c

File tree

3 files changed

+75
-25
lines changed

3 files changed

+75
-25
lines changed

.github/workflows/publish-documentation.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@ jobs:
3232
working-directory: docs
3333
run: pnpm run generate:docs
3434

35+
- name: Upload generated docs artifact
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: docs-generated
39+
path: |
40+
docs/generated-docs/**
41+
docs/app/utils/versions.ts
42+
if-no-files-found: error
43+
3544
deploy:
3645
name: 🚀 Deploy Release
3746
needs: [build-docs]
@@ -40,6 +49,15 @@ jobs:
4049
name: docs-release
4150
steps:
4251
- uses: actions/checkout@v4
52+
- name: Download generated docs
53+
uses: actions/download-artifact@v4
54+
with:
55+
name: docs-generated
56+
path: docs
57+
58+
# check TODO remove this
59+
- name: List generated payload
60+
run: ls -laR docs/generated-docs | head -n 200
4361
- uses: forge-42/fly-deploy@v1.0.0-rc.2
4462
id: deploy
4563
env:

.github/workflows/validate.yaml

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,58 @@ jobs:
4444
- name: 🔎 Validate
4545
run: pnpm run test
4646

47+
48+
build-docs:
49+
if: ${{ github.event_name == 'pull_request' }}
50+
name: Build Docs
51+
runs-on: ubuntu-latest
52+
steps:
53+
- name: Checkout
54+
uses: actions/checkout@v4
55+
with:
56+
fetch-depth: 0
57+
- name: Setup pnpm
58+
uses: pnpm/action-setup@v4
59+
- name: Setup Node
60+
uses: actions/setup-node@v4
61+
with:
62+
node-version-file: "package.json"
63+
cache: "pnpm"
64+
65+
- name: Install deps
66+
run: pnpm install --prefer-offline --frozen-lockfile
67+
68+
- name: Generate docs
69+
working-directory: docs
70+
run: pnpm run generate:docs
71+
72+
- name: Upload generated docs artifact
73+
uses: actions/upload-artifact@v4
74+
with:
75+
name: docs-generated
76+
path: |
77+
docs/generated-docs/**
78+
docs/app/utils/versions.ts
79+
if-no-files-found: error
80+
4781
deploy-docs-pr-preview:
4882
if: ${{ github.event_name == 'pull_request' }}
49-
name: "🚀 Deploy Docs"
50-
needs: [lint, validate]
83+
name: 🚀 Deploy Docs
84+
needs: [lint, validate, build-docs]
5185
runs-on: ubuntu-latest
5286
environment:
5387
name: docs-release
54-
url: ${{ steps.deploy.outputs.app_url }}
5588
steps:
5689
- uses: actions/checkout@v4
90+
- name: Download generated docs
91+
uses: actions/download-artifact@v4
92+
with:
93+
name: docs-generated
94+
path: docs
95+
96+
# check TODO remove this
97+
- name: List generated payload
98+
run: ls -laR docs/generated-docs | head -n 200
5799
- uses: forge-42/fly-deploy@v1.0.0-rc.2
58100
id: deploy
59101
env:

docs/Dockerfile

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,41 @@
1-
21
# syntax = docker/dockerfile:1.4
32

4-
# Base dependencies stage
53
ARG NODE_VERSION=22.17.0
64
FROM node:${NODE_VERSION}-slim AS base
75

86
LABEL fly_launch_runtime="Node.js"
9-
10-
# Node.js app lives here
117
WORKDIR /app
8+
ENV NODE_ENV=production
129

13-
# Set production environment
14-
ENV NODE_ENV="production"
15-
16-
# Install pnpm
1710
ARG PNPM_VERSION=10.18.0
1811
RUN npm install -g pnpm@$PNPM_VERSION
1912

20-
21-
# Throw-away build stage to reduce size of final image
13+
# --- Build stage ---
2214
FROM base AS build
2315

24-
# Install packages needed to build node modules
16+
# System deps only if you have native modules; otherwise you can drop this
2517
RUN apt-get update -qq && \
26-
apt-get install --no-install-recommends -y build-essential node-gyp pkg-config python-is-python3 git
18+
apt-get install --no-install-recommends -y build-essential node-gyp pkg-config python-is-python3 && \
19+
rm -rf /var/lib/apt/lists/*
2720

28-
# Install node modules
21+
# Install deps
2922
COPY .npmrc package.json ./
3023
RUN pnpm install --prod=false
3124

32-
# Copy application code
25+
# Copy the application (including the previously downloaded artifact under docs/)
3326
COPY . .
3427

35-
# Build application
36-
RUN pnpm run generate:docs
28+
# IMPORTANT: we no longer generate docs here; they were provided by CI
29+
# Build the app (should read from docs/generated-docs/* and versions.ts that CI uploaded)
3730
RUN pnpm run build
3831

39-
# Remove development dependencies
32+
# Prune dev deps
4033
RUN pnpm prune --prod
4134

42-
43-
# Final stage for app image
35+
# --- Runtime stage ---
4436
FROM base
4537

46-
# Copy built application
4738
COPY --from=build /app /app
4839

49-
# Start the server by default, this can be overwritten at runtime
5040
EXPOSE 3000
51-
CMD [ "pnpm", "run", "start" ]
41+
CMD ["pnpm","run","start"]

0 commit comments

Comments
 (0)