Merge pull request 'ci: integrate husky to pipe' (#1) from ci-protections into master
All checks were successful
Portfolio/pipeline/head This commit looks good

Reviewed-on: server/portfolio#1
This commit was merged in pull request #1.
This commit is contained in:
Lucas
2026-01-09 15:24:37 +00:00
11 changed files with 2185 additions and 16 deletions

View File

@@ -1 +1,2 @@
NODE_VERSION=24
CADDY_VERSION=2.10.2

1
.husky/commit-msg Normal file
View File

@@ -0,0 +1 @@
pnpm exec commitlint --edit "$1"

2
.husky/pre-commit Normal file
View File

@@ -0,0 +1,2 @@
pnpm run lint
pnpm run check

View File

@@ -1,7 +1,8 @@
ARG NODE_VERSION
ARG CADDY_VERSION
# --- BUILD ---
FROM node:24-alpine AS build
FROM node:${NODE_VERSION}-alpine AS build
RUN corepack enable && corepack prepare pnpm@latest --activate
ENV ASTRO_TELEMETRY_DISABLED=1
@@ -10,10 +11,19 @@ WORKDIR /app
# Copy depedencies
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
# Copy all and build
# Install pnpm with cache
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
PNPM_HOME="/pnpm" pnpm install --frozen-lockfile
# Copy all
COPY . .
# Check files
RUN pnpm run lint
RUN pnpm run check
# Build
RUN pnpm build
# --- DEPLOY ---

1
commitlint.config.js Normal file
View File

@@ -0,0 +1 @@
export default { extends: ['@commitlint/config-conventional'] };

View File

@@ -3,6 +3,7 @@ services:
build:
context: .
args:
- NODE_VERSION=${NODE_VERSION}
- CADDY_VERSION=${CADDY_VERSION}
image: portfolio:${PORTFOLIO_VERSION}
container_name: portfolio

24
eslint.config.mjs Normal file
View File

@@ -0,0 +1,24 @@
import eslintPluginAstro from 'eslint-plugin-astro';
import tsParser from '@typescript-eslint/parser';
export default [
// Configuration pour les fichiers Astro
...eslintPluginAstro.configs.recommended,
{
files: ["**/*.astro"],
languageOptions: {
parser: eslintPluginAstro.parser,
parserOptions: {
parser: tsParser,
extraFileExtensions: [".astro"],
},
},
rules: {
// Tes règles personnalisées ici
},
},
// On ignore le dossier de build
{
ignores: ["dist/*", ".astro/*"]
}
];

View File

@@ -6,13 +6,34 @@
"dev": "astro dev",
"build": "astro build",
"preview": "astro preview",
"astro": "astro"
"astro": "astro",
"lint": "eslint .",
"check": "astro check",
"prepare": "husky"
},
"dependencies": {
"@astrojs/check": "^0.9.6",
"@astrojs/mdx": "^4.3.13",
"@astrojs/rss": "^4.0.14",
"@astrojs/sitemap": "^3.6.0",
"astro": "^5.16.6",
"sharp": "^0.34.3"
},
"devDependencies": {
"@commitlint/cli": "^20.3.1",
"@commitlint/config-conventional": "^20.3.1",
"@typescript-eslint/eslint-plugin": "^8.52.0",
"@typescript-eslint/parser": "^8.52.0",
"astro-eslint-parser": "^1.2.2",
"eslint": "^9.39.2",
"eslint-plugin-astro": "^1.5.0",
"husky": "^9.1.7",
"typescript": "^5.9.3"
},
"pnpm": {
"onlyBuiltDependencies": [
"esbuild",
"sharp"
]
}
}

2126
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

3
pnpm-workspace.yaml Normal file
View File

@@ -0,0 +1,3 @@
ignoredBuiltDependencies:
- esbuild
- sharp

View File

@@ -1,6 +1,5 @@
{
"extends": "astro/tsconfigs/strict",
"include": [".astro/types.d.ts", "**/*"],
"exclude": ["dist"],
"compilerOptions": {
"strictNullChecks": true