This commit is contained in:
isUnknown 2025-10-08 15:54:17 +02:00
commit 1dad073ea1
5 changed files with 61 additions and 51 deletions

View file

@ -4,15 +4,16 @@ stages:
variables:
COMPOSER_ALLOW_SUPERUSER: '1'
build_prod:
# PREPROD
build_preprod:
stage: build
only:
- prod
- preprod
image: composer:2
script:
- apk add --no-cache nodejs npm
- npm install
- npm run build
- npm run build:preprod
- cd dist
- composer install --no-dev --optimize-autoloader --ignore-platform-req=ext-gd
- cd ..
@ -24,17 +25,44 @@ build_prod:
paths:
- node_modules/
build_preprod:
stage: build
deploy_preprod:
stage: deploy
image: node:latest
only:
- preprod
before_script:
- apt-get update -qq && apt-get install -y rsync sshpass
script:
- cd dist
- |
rsync_deploy() {
local src=$1
local dst=$2
local exclude=$3
cmd="sshpass -p \"$PASSWORD\" rsync -az --delete -O"
[[ -n $exclude ]] && cmd="$cmd $exclude"
cmd="$cmd -e 'ssh -p 2244 -o StrictHostKeyChecking=no' $src $USERNAME@$HOST:$dst"
echo "$cmd"
eval $cmd
}
rsync_deploy site/ "$PREPROD_PATH/site/" "--exclude 'accounts/' --exclude 'cache/' --exclude 'sessions/'"
rsync_deploy vendor/ "$PREPROD_PATH/vendor/"
rsync_deploy kirby/ "$PREPROD_PATH/kirby/"
rsync_deploy assets/ "$PREPROD_PATH/assets/" "--exclude 'tiles/'"
# PROD
build_prod:
stage: build
only:
- prod
image: composer:2
script:
- apk add --no-cache nodejs npm
- npm install
- npm run build:preprod
- cd dist -
composer install --no-dev --optimize-autoloader --ignore-platform-req=ext-gd
- npm run build
- cd dist
- composer install --no-dev --optimize-autoloader --ignore-platform-req=ext-gd
- cd ..
artifacts:
paths:
@ -69,29 +97,3 @@ deploy_prod:
rsync_deploy vendor/ "$PROD_PATH/vendor/"
rsync_deploy kirby/ "$PROD_PATH/kirby/"
rsync_deploy assets/ "$PROD_PATH/assets/" "--exclude 'tiles/'"
deploy_preprod:
stage: deploy
image: node:latest
only:
- preprod
before_script:
- apt-get update -qq && apt-get install -y rsync sshpass
script:
- cd dist
- |
rsync_deploy() {
local src=$1
local dst=$2
local exclude=$3
cmd="sshpass -p \"$PASSWORD\" rsync -az --delete -O"
[[ -n $exclude ]] && cmd="$cmd $exclude"
cmd="$cmd -e 'ssh -p 2244 -o StrictHostKeyChecking=no' $src $USERNAME@$HOST:$dst"
echo "$cmd"
eval $cmd
}
rsync_deploy site/ "$PREPROD_PATH/site/" "--exclude 'accounts/' --exclude 'cache/' --exclude 'sessions/'"
rsync_deploy vendor/ "$PREPROD_PATH/vendor/"
rsync_deploy kirby/ "$PREPROD_PATH/kirby/"
rsync_deploy assets/ "$PREPROD_PATH/assets/" "--exclude 'tiles/'"

View file

@ -6,6 +6,7 @@
"scripts": {
"dev": "vite",
"build": "vite build",
"build:preprod": "vite build --mode=staging",
"preview": "vite preview"
},
"dependencies": {

View file

@ -3,7 +3,7 @@
$regenerateSteps = require_once(__DIR__ . '/hooks/page-update--regenerate-project-steps-cache.php');
return [
'debug' => Dir::exists('assets/dist') ? false: true,
'debug' => $_SERVER['HTTP_HOST'] !== 'designtopack.groupe-pochet.fr',
'cache' => [
'pages' => [
'active' => true

View file

@ -126,12 +126,13 @@ const { isEmptyBrief } = useProjectStore();
const { page } = storeToRefs(usePageStore());
const unreadNotificationsCount = computed(() => {
if (!user.value) return undefined;
const count = notifications.value.filter(
(notification) => !notification.isRead
).length;
if (count === 0) return undefined;
return count;
if (!user.value) return 0;
const count =
notifications.value?.filter((notification) => !notification.isRead)
.length ?? 0;
return count === 0 ? 0 : count;
});
const mainItems = [
@ -320,7 +321,7 @@ button[aria-controls='menu'][aria-expanded='false']
align-items: center;
width: 100%;
min-height: 2.5rem; /* 40px */
padding: .66rem var(--space-16);
padding: 0.66rem var(--space-16);
gap: var(--space-12);
border-radius: var(--rounded-lg);
}

View file

@ -7,21 +7,27 @@ export const useProjectsStore = defineStore('projects', () => {
const projects = ref(null);
const currentProjects = computed(() => {
return projects.value
.filter((project) => project.status === 'listed')
.sort((a, b) => new Date(b.modified) - new Date(a.modified));
return (
projects.value
?.filter((project) => project.status === 'listed')
.sort((a, b) => new Date(b.modified) - new Date(a.modified)) ?? []
);
});
const draftProjects = computed(() => {
return projects.value
.filter((project) => project.status === 'draft')
.sort((a, b) => new Date(b.modified) - new Date(a.modified));
return (
projects.value
?.filter((project) => project.status === 'draft')
.sort((a, b) => new Date(b.modified) - new Date(a.modified)) ?? []
);
});
const archivedProjects = computed(() => {
return projects.value
.filter((project) => project.status === 'unlisted')
.sort((a, b) => new Date(b.modified) - new Date(a.modified));
return (
projects.value
?.filter((project) => project.status === 'unlisted')
.sort((a, b) => new Date(b.modified) - new Date(a.modified)) ?? []
);
});
const api = useApiStore();