diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bad8228..dc63319 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,27 +1,26 @@ name: Quality on: - push: - branches: - - main - pull_request: - types: [opened, synchronize, reopened] + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened] jobs: - test-build: - name: Test & build - runs-on: ubuntu-latest - strategy: - matrix: - node: [ 22 ] - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - - run: yarn - - run: yarn test --coverage --watch=false - - run: yarn build - - name: SonarCloud Scan - uses: sonarsource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets. SONAR_TOKEN }} + test-build: + name: Test & build + runs-on: ubuntu-latest + strategy: + matrix: + node: [22] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + - run: npm i + - run: npm run build + - name: SonarCloud Scan + uses: sonarsource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets. SONAR_TOKEN }} diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 9ef64da..b0eeceb 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -8,6 +8,7 @@ jobs: test: timeout-minutes: 60 runs-on: ubuntu-latest + if: false steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 diff --git a/.gitignore b/.gitignore index 996e3ea..1de5885 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,42 @@ -temp_dist -build -node_modules +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.* +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/versions + +# testing +/coverage +/test-results + +# next.js +/.next/ +/out/ + +# production +/build + +# misc .DS_Store -.idea -coverage -/test-results/ -/playwright-report/ -/blob-report/ -/playwright/.cache/ +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.pnpm-debug.log* + +# env files (can opt-in for committing if needed) +.env* + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts diff --git a/Dockerfile b/Dockerfile index 500bf2b..2294252 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,31 +1,28 @@ -### BUILD STEP ### +# Étape 1 : Build +FROM node:20-alpine AS builder -FROM node:latest AS builder +WORKDIR /app -WORKDIR /impala +COPY package.json package-lock.json* ./ -COPY ./ ./ +RUN npm install -RUN yarn && yarn build +COPY . . -### EXECUTION STEP ### +RUN npm run build -FROM nginxinc/nginx-unprivileged:1.27-alpine +FROM node:20-alpine AS runner -# Non root user -ENV NGINX_USER_ID=101 -ENV NGINX_GROUP_ID=101 -ENV NGINX_USER=nginx -ENV NGINX_GROUP=nginx +ENV NODE_ENV=production +ENV PORT=3000 -USER $NGINX_USER_ID +WORKDIR /app -# Add build to nginx root webapp -COPY --from=builder --chown=$NGINX_USER:$NGINX_GROUP /impala/build /usr/share/nginx/html +COPY --from=builder /app/public ./public +COPY --from=builder /app/.next ./.next +COPY --from=builder /app/node_modules ./node_modules +COPY --from=builder /app/package.json ./package.json -# Copy nginx configuration -# Copier le fichier de configuration Nginx -COPY nginx.conf /etc/nginx/nginx.conf.template +EXPOSE 3000 -# Substituer les variables d'environnement et démarrer Nginx -#CMD ["sh", "-c", "envsubst < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf && nginx -g 'daemon off;'"] +CMD ["npm", "start"] \ No newline at end of file diff --git a/LICENSE b/LICENSE index 1701be8..d1e1072 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1 @@ MIT License - -Copyright (c) 2021 Insee - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/app/favicon.ico b/app/favicon.ico new file mode 100644 index 0000000..718d6fe Binary files /dev/null and b/app/favicon.ico differ diff --git a/src/index.css b/app/globals.css similarity index 100% rename from src/index.css rename to app/globals.css diff --git a/app/layout.tsx b/app/layout.tsx new file mode 100644 index 0000000..39d4c39 --- /dev/null +++ b/app/layout.tsx @@ -0,0 +1,36 @@ +/* eslint-disable @next/next/no-sync-scripts */ +import "./globals.css"; + +export default function RootLayout({ + children +}: Readonly<{ + children: React.ReactNode; +}>) { + return ( + +
+ + + + + + + + + + + +
+ 
Liste des produits de l'Enquête Annuelle de Production 2024
-Liste des produits de l'Enquête Annuelle de Production 2024
+Liste des produits des Enquêtes Mensuelles de Branche 2025
-Liste des produits des Enquêtes Mensuelles de Branche 2025
+