Skip to content

📚 The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.

Optimize build

Smaug6739c8b4c39d7559
diff --git a/.github/workflows/docker-image-deploy.yml b/.github/workflows/docker-image-deploy.yml
index 9e63a337..12e0816e 100644
--- a/.github/workflows/docker-image-deploy.yml
+++ b/.github/workflows/docker-image-deploy.yml
@@ -3,15 +3,20 @@ name: Build and Publish Docker Images
on:
push:
branches: [deploy]
+ paths:
+ - backend/**
+ - frontend/**
+ - .github/workflows/**
+
+permissions:
+ contents: read
+ packages: write
jobs:
- build-and-push:
+ backend:
+ name: Build & Push Backend
runs-on: ubuntu-latest
- permissions:
- contents: read
- packages: write
-
steps:
- name: Checkout repository
uses: actions/checkout@v4
@@ -22,6 +27,9 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
+ with:
+ driver-opts: |
+ image=moby/buildkit:latest
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
@@ -42,6 +50,31 @@ jobs:
ghcr.io/${{ steps.repo.outputs.repo_lc }}-backend:latest
ghcr.io/${{ steps.repo.outputs.repo_lc }}-backend:${{ github.ref_name }}
+ frontend:
+ name: Build & Push Frontend
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+
+ - name: Set lowercase repository name
+ id: repo
+ run: echo "repo_lc=$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
+
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v3
+ with:
+ driver-opts: |
+ image=moby/buildkit:latest
+
+ - name: Log in to GitHub Container Registry
+ uses: docker/login-action@v3
+ with:
+ registry: ghcr.io
+ username: ${{ github.actor }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+
- name: Build and push frontend image
uses: docker/build-push-action@v6
with:
diff --git a/frontend/Dockerfile b/frontend/Dockerfile
index 950b5c8b..afd84be7 100644
--- a/frontend/Dockerfile
+++ b/frontend/Dockerfile
@@ -4,12 +4,16 @@
FROM oven/bun:1 AS builder
WORKDIR /app
+
+# Dépendances (cacheable)
COPY package.json bun.lock ./
-RUN bun install
+RUN bun install --frozen-lockfile
+
+# Code source
COPY . .
+
ENV NODE_ENV=production
RUN bun run build
-
# ========================================
# Runtime stage
# ========================================