Skip to content

Commit 46988c5

Browse files
Test MEP (#407)
* Implement PR deployment and prod / preprod enviroment (#402) * Implement PR deployment and prod / preprod enviroment * Restore gcr subdirectory name * Add tag remover job * test syntax * Use GITHUB_ENV * Use github env in helm * Enable Build * Fix syntax * Try fix on helm release * Fix release name * debug cors * Edit cleanup job * Fix cors * Enable build * Change staging branch name * Remove bucket * Change preprod URLs * edit cors in helm upgrade * Add prod branch name temp * Feat: add references pages (#405) * feat: add references page * feat: update meta and opengraph images * fix: cecile review * Restore MAPBOX_KEY * Set ROOT URL in build args * Use the right step for NEXT_ROOT_URL * Revert "Use the right step for NEXT_ROOT_URL" This reverts commit e2305ed. * Update args in dockerfile * Remove blank space in URL * feat: add motivher and france tv sponsors (#408) --------- Co-authored-by: Laury S <[email protected]>
1 parent 24b6f02 commit 46988c5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+365
-135
lines changed

.github/workflows/build.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,20 @@ jobs:
170170
tags: |
171171
type=raw,value=${{ github.sha }},priority=9999
172172
${{ inputs.tags }}
173+
- name: Define URL
174+
run: |
175+
set -o pipefail
176+
if [[ "${{ github.ref }}" == 'refs/heads/prod' ]]; then
177+
echo "URL=api-platform.com" >> "$GITHUB_ENV"
178+
else
179+
CONTEXT=nonprod
180+
if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then
181+
export RELEASE_NAME=pr-$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")
182+
else
183+
export RELEASE_NAME=${{ github.ref_name }}
184+
fi
185+
echo "URL=$RELEASE_NAME.apip.preprod-tilleuls.ovh" >> "$GITHUB_ENV"
186+
fi
173187
- name: Build and push
174188
uses: docker/build-push-action@v4
175189
with:
@@ -179,6 +193,7 @@ jobs:
179193
push: ${{ inputs.push }}
180194
tags: ${{ steps.docker-metadata.outputs.tags }}
181195
labels: ${{ steps.docker-metadata.outputs.labels }}
196+
build-args: NEXT_ROOT_URL=${{ env.URL }}
182197
cache-from: |
183198
type=registry,ref=eu.gcr.io/${{ secrets.gke-project }}/website/pwa:latest
184199
type=registry,ref=eu.gcr.io/${{ secrets.gke-project }}/website/pwa:${{ github.sha }}

pwa/.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
NEXT_PUBLIC_EVENT_BRITE_ID=483719928327
2-
NEXT_ROOT_URL=https://test-v3.preprod-tilleuls.ovh
32
NEXT_PUBLIC_DOCSEARCH_API_KEY = 52043128794330355240504c03762281
43
NEXT_PUBLIC_DOCSEARCH_INDEX_NAME = api-platform
5-
NEXT_PUBLIC_DOCSEARCH_APP_ID = ZQ00U6B6ML
4+
NEXT_PUBLIC_DOCSEARCH_APP_ID = ZQ00U6B6ML
5+
NEXT_PUBLIC_MAPBOX_KEY=pk.eyJ1IjoiZ2luaWZpenoiLCJhIjoiY2tsZ2c3d3Z1MWs1MDJvbWpvdjM2MGg4ZSJ9.5jBAlLJbO-gf2_BQGzfZ0Q

pwa/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ FROM builder_base AS builder
3939
COPY --link . .
4040
COPY --from=deps --link /srv/app/node_modules ./node_modules
4141

42+
ARG NEXT_ROOT_URL
43+
ENV NEXT_ROOT_URL=$NEXT_ROOT_URL
44+
# RUN echo $NEXT_ROOT_URL
45+
4246
RUN --mount=type=secret,id=GITHUB_KEY \
4347
export GITHUB_KEY=$(cat /run/secrets/GITHUB_KEY) ; \
4448
if [ -z "$GITHUB_KEY" ]; then \

pwa/app/(common)/community/page.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,14 @@ export default async function Page() {
122122
maskColor="gray-100"
123123
darkModeColor="blue-black"
124124
>
125-
<div className="absolute left-0 top-0 w-full h-full bg-[url('/images/community_cover.png')] bg-[70%] bg-cover opacity-70 z-0" />
125+
<div className="absolute left-0 top-0 w-full h-full opacity-70 z-0">
126+
<Image
127+
src="/images/community_cover.png"
128+
fill
129+
className="w-full h-full object-cover"
130+
alt=""
131+
/>
132+
</div>
126133
<div className="container relative z-10 py-24 text-white flex flex-col justify-center min-h-full">
127134
<Heading size="xl" level="h1" className="pt-8">
128135
Our <strong>community</strong>

pwa/app/(common)/events/components/EventsPage.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { Event as EventType } from "types";
66
import EventFilterDropDown from "./EventFilterDropDown";
77
import EventCard from "./EventCard";
88
import ShapeSection from "components/common/ShapeSection";
9+
import Image from "next/image";
910

1011
interface EventsPageProps {
1112
events: EventType[];
@@ -52,7 +53,14 @@ export default function EventsPage({ events }: EventsPageProps) {
5253
maskColor="gray-100"
5354
darkModeColor="blue-black"
5455
>
55-
<div className="absolute left-0 top-0 w-full h-full bg-[url('/images/events_cover.jpg')] bg-[70%] bg-cover opacity-70 z-0" />
56+
<div className="absolute left-0 top-0 w-full h-full opacity-70 z-0">
57+
<Image
58+
src="/images/events_cover.jpg"
59+
fill
60+
className="w-full h-full object-cover"
61+
alt=""
62+
/>
63+
</div>
5664
<div className="container relative z-10 py-24 text-white flex flex-col justify-center min-h-full">
5765
<Heading size="xl" level="h1" className="pt-8">
5866
Our <strong>events</strong>

pwa/app/(common)/help/page.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,15 @@ export default async function Page() {
3131
maskColor="white"
3232
darkModeColor="blue-black"
3333
>
34-
<div className="absolute left-0 top-0 w-full h-full bg-[url('/images/help_cover.jpg')] bg-top bg-cover opacity-70 z-0" />
34+
<div className="absolute left-0 top-0 w-full h-full opacity-70 z-0">
35+
<Image
36+
src="/images/help_cover.jpg"
37+
fill
38+
className="w-full h-full object-cover object-top"
39+
alt=""
40+
/>
41+
</div>
42+
3543
<div className="container relative z-10 py-24 text-white flex flex-col justify-center min-h-full">
3644
<Heading size="xl" level="h1" className="pt-8">
3745
Need <strong>help?</strong>

pwa/app/(common)/layout.tsx

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import "@docsearch/css";
33
import { Poppins } from "next/font/google";
44
import Layout from "components/layout/Layout";
55
import { Metadata } from "next";
6+
import { getRootUrl } from "utils";
67

78
const poppins = Poppins({
89
variable: "--font-poppins",
@@ -14,9 +15,7 @@ const poppins = Poppins({
1415
export async function generateMetadata(): Promise<Metadata> {
1516
const dictionary = await import(`data/meta.json`);
1617

17-
const BASE_URL =
18-
"https://" + process.env.NEXT_ROOT_URL || "https://api-platform.com";
19-
const URL_LOGO = `${BASE_URL}/images/logo.png`;
18+
const BASE_URL = getRootUrl();
2019

2120
const title = dictionary["layout"].title;
2221
const description = dictionary["layout"].description;
@@ -33,23 +32,17 @@ export async function generateMetadata(): Promise<Metadata> {
3332
colorScheme: "dark",
3433
creator: "Kévin Dunglas",
3534
themeColor: "#0099a1",
36-
icons: {
37-
icon: "/favicon.svg",
38-
apple: "/apple-touch-icon.png",
39-
},
4035
openGraph: {
4136
url: "https://api-platform.com",
4237
title: title,
4338
description: description,
4439
type: "website",
4540
siteName: "API Platform",
46-
images: URL_LOGO,
4741
},
4842
twitter: {
4943
card: "summary_large_image",
5044
title: title,
5145
description: description,
52-
images: URL_LOGO,
5346
creator: "@dunglas",
5447
},
5548
};

pwa/app/(common)/references/page.tsx

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
import { Metadata } from "next";
2+
import Heading from "components/common/typography/Heading";
3+
import { openSourceData, otherData } from "data/logos";
4+
import Link from "next/link";
5+
import Image from "next/image";
6+
import classNames from "classnames";
7+
import ShapeSection from "components/common/ShapeSection";
8+
9+
export async function generateMetadata(): Promise<Metadata> {
10+
const dictionary = await import(`data/meta.json`);
11+
12+
return {
13+
title: dictionary["references"].title,
14+
description: dictionary["references"].description,
15+
openGraph: {
16+
title: dictionary["references"].title,
17+
description: dictionary["references"].description,
18+
},
19+
twitter: {
20+
title: dictionary["references"].title,
21+
description: dictionary["references"].description,
22+
},
23+
};
24+
}
25+
26+
export default async function Page() {
27+
return (
28+
<div className="pt-16">
29+
<div className="bg-blue py-12 text-white dark:text-blue-black">
30+
<div className="container text-left">
31+
<Heading size="xl" level="h1">
32+
They use <strong>API Platform</strong>
33+
</Heading>
34+
</div>
35+
</div>
36+
<div className="container pt-4">
37+
<div className="mb-6">
38+
<Heading
39+
level="h2"
40+
size="lg"
41+
className="w-full border-b-2 border-b-blue mb-4"
42+
>
43+
Open source projects
44+
</Heading>
45+
</div>
46+
<div className="grid gap-6 grid-cols-[repeat(auto-fill,minmax(120px,1fr))] sm:grid-cols-[repeat(auto-fill,minmax(150px,1fr))] w-full place-content-center">
47+
{openSourceData.map((ref) => (
48+
<Link
49+
key={ref.name}
50+
href={ref.link}
51+
target="_blank"
52+
rel="noopener noreferrer"
53+
className={classNames(
54+
"border border-solid p-5 border-blue-extralight dark:border-blue-dark opacity-75 transition-all cursor-pointer w-full flex flex-col justify-center items-center group text-center hover:opacity-100 hover:shadow-xl hover:bg-blue/10 hover:scale-105"
55+
)}
56+
>
57+
<div className="relative aspect-square w-full grayscale brithgness-100 group-hover:grayscale-0 group-hover:opacity-100 dark:group-hover:grayscale dark:contrast-150 dark:brightness-50 dark:invert transition-all">
58+
<Image
59+
alt={ref.name}
60+
src={`/images/references/oss/${ref.logo}.png`}
61+
height={50}
62+
width={200}
63+
className="object-contain object-center w-full h-full"
64+
/>
65+
</div>
66+
<p className="text-md leading-none font-title">{ref.name}</p>
67+
</Link>
68+
))}
69+
</div>
70+
</div>
71+
<div className="container py-12">
72+
<div className="mb-2">
73+
<Heading
74+
level="h2"
75+
size="lg"
76+
className="w-full border-b-2 border-b-blue mb-4"
77+
>
78+
Companies
79+
</Heading>
80+
</div>
81+
<div className="flex flex-row flex-wrap">
82+
{otherData.map((ref) => (
83+
<Link
84+
key={ref.name}
85+
href={ref.link}
86+
target="_blank"
87+
rel="noopener noreferrer"
88+
className="relative w-1/2 p-5 opacity-75 grayscale hover:grayscale-0 brithgness-100 transition-all cursor-pointer | sm:w-1/3 | md:w-1/4 | lg:w-1/6 | hover:opacity-100 | dark:hover:grayscale dark:contrast-150 dark:brightness-50 dark:invert"
89+
>
90+
<Image
91+
alt={ref.name}
92+
src={`/images/references/${ref.logo}.png`}
93+
height={50}
94+
width={200}
95+
className="max-w-[120px] mx-auto"
96+
/>
97+
</Link>
98+
))}
99+
</div>
100+
</div>
101+
</div>
102+
);
103+
}

pwa/app/(con)/[locale]/con/2021/components/HomePage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export default function HomePage({ speakers, partners }: HomePageProps) {
5151
</div>
5252
</Section>
5353

54-
<Venue subtitle={t("2021.venue.subtitle")} />
54+
<Venue subtitle={t("2021.venue.subtitle")} tip={t("2021.venue.tip")} />
5555

5656
<Covid />
5757

pwa/app/(con)/[locale]/con/2021/layout.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import LayoutBase from "components/con/layout/LayoutBase";
33
import ContactCard from "components/con/layout/ContactCard";
44
import nav from "data/con/2021/nav";
55
import footer from "data/con/2021/footer";
6-
import { OG_IMAGE, URL } from "data/con/2021/meta";
76
import { Metadata } from "next";
87
import { getEditionEventData } from "utils/con";
98
import { i18n } from "i18n/i18n-config";
9+
import { getRootUrl } from "utils";
1010

1111
type Props = {
1212
params: { edition: string; locale: string };
@@ -18,6 +18,8 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
1818

1919
const dictionary = await import(`i18n/meta/${locale}.json`);
2020

21+
const URL = `${getRootUrl()}/con/2021`;
22+
2123
return {
2224
title: {
2325
default: dictionary[2021].title,
@@ -28,12 +30,10 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
2830
url: URL,
2931
title: dictionary[2021].title,
3032
description: dictionary[2021].description,
31-
images: OG_IMAGE,
3233
},
3334
twitter: {
3435
title: dictionary[2021].title,
3536
description: dictionary[2021].description,
36-
images: OG_IMAGE,
3737
},
3838
};
3939
}

0 commit comments

Comments
 (0)