Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

Commit

Permalink
fix: build && export
Browse files Browse the repository at this point in the history
  • Loading branch information
maxgfr committed Feb 18, 2022
1 parent 53ff755 commit f10de92
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 8 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build

on: [pull_request, push]

concurrency:
cancel-in-progress: true
group: build-${{ github.ref }}

jobs:
code:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Restore cache
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: |
yarn install --prefer-offline --frozen-lockfile
- name: Lint
run: |
yarn build:export
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ ARG PRODUCTION
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN yarn build:export
RUN if [ -z "$PRODUCTION" ]; then \
echo "Copy staging values"; \
cp .env.staging .env.production; \
cp ./public/robots.staging.txt ./public/robots.txt; \
fi \
&& yarn build:export

# Production image, copy all the files and run next
FROM ghcr.io/socialgouv/docker/nginx:6.64.2 AS runner
Expand Down
2 changes: 1 addition & 1 deletion public/sitemap-0.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
<url><loc>https://template.fabrique.social.gouv.fr</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2022-02-18T17:25:42.798Z</lastmod></url>
<url><loc>https://template.fabrique.social.gouv.fr</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2022-02-18T17:43:26.532Z</lastmod></url>
</urlset>
3 changes: 1 addition & 2 deletions src/components/footer/body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ import {
FooterOperator,
} from "@dataesr/react-dsfr";
import { FooterBodySectionProps } from "./type";
import Image from "next/image";

export const Body = (props: FooterBodySectionProps): JSX.Element => (
<FooterBody description={props.description}>
<Logo>{props.ministryName}</Logo>
{props.image && (
<FooterOperator>
<Image src={props.image.src} alt={props.image.alt} />
<img src={props.image.src} alt={props.image.alt} />
</FooterOperator>
)}
{props.links?.map((link, index) => (
Expand Down
6 changes: 2 additions & 4 deletions src/components/header/body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,16 @@ import {
Tool,
} from "@dataesr/react-dsfr";
import { HeaderBodyProps } from "./type";
import Image from "next/image";

export const Body = (props: HeaderBodyProps): JSX.Element => (
<HeaderBody>
<Logo splitCharacter={props.splitTitleLength ?? 10}>{props.mainTitle}</Logo>
{props.image && (
<HeaderOperator>
<Image
<img
src={props.image.src}
alt={props.image.alt}
height={props.image.height}
width={props.image.width}
style={{ height: props.image.height, width: props.image.width }}
/>
</HeaderOperator>
)}
Expand Down

0 comments on commit f10de92

Please sign in to comment.