Skip to content

Commit

Permalink
fix: name env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriel-logan committed May 28, 2024
1 parent d98f2c3 commit 915f12d
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 24 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/nextjs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ jobs:
run: ${{ steps.detect-package-manager.outputs.runner }} next build
env:
NODE_ENV: production
GOOGLE_SEARCH_CONSOLE_API_KEY: ${{ secrets.GOOGLE_SEARCH_CONSOLE_API_KEY }}
GOOGLE_ADSENSE_CLIENT_ID: ${{ secrets.GOOGLE_ADSENSE_CLIENT_ID }}
WEBSITE_DNS_NAME: ${{ secrets.WEBSITE_DNS_NAME }}
WEBSITE_URL: ${{ secrets.WEBSITE_URL }}
NEXT_PUBLIC_GOOGLE_SEARCH_CONSOLE_API_KEY: ${{ secrets.GOOGLE_SEARCH_CONSOLE_API_KEY }}
NEXT_PUBLIC_GOOGLE_ADSENSE_CLIENT_ID: ${{ secrets.GOOGLE_ADSENSE_CLIENT_ID }}
NEXT_PUBLIC_WEBSITE_DNS_NAME: ${{ secrets.WEBSITE_DNS_NAME }}
NEXT_PUBLIC_WEBSITE_URL: ${{ secrets.WEBSITE_URL }}
working-directory: ./docs
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
Expand Down
3 changes: 3 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,6 @@ yarn-error.log*
*.tsbuildinfo
next-env.d.ts
.env

# Temporary files
backupnews.tsx
24 changes: 14 additions & 10 deletions docs/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ export const metadata: Metadata = {
"Validator",
"validate",
],
verification: { google: process.env.GOOGLE_SEARCH_CONSOLE_API_KEY },
verification: {
google: process.env.NEXT_PUBLIC_GOOGLE_SEARCH_CONSOLE_API_KEY,
},
appleWebApp: {
title: t("Multiform Validator"),
capable: true,
Expand All @@ -56,31 +58,31 @@ export const metadata: Metadata = {
icons: [
{
rel: "android-chrome-192x192",
url: `${process.env.WEBSITE_URL}/android-chrome-192x192.png`,
url: `${process.env.NEXT_PUBLIC_WEBSITE_URL}/android-chrome-192x192.png`,
},
{
rel: "android-chrome-512x512",
url: `${process.env.WEBSITE_URL}/android-chrome-512x512.png`,
url: `${process.env.NEXT_PUBLIC_WEBSITE_URL}/android-chrome-512x512.png`,
},
{
rel: "apple-touch-icon",
url: `${process.env.WEBSITE_URL}/apple-touch-icon.png`,
url: `${process.env.NEXT_PUBLIC_WEBSITE_URL}/apple-touch-icon.png`,
},
{
rel: "favicon-16x16",
url: `${process.env.WEBSITE_URL}/favicon-16x16.png`,
url: `${process.env.NEXT_PUBLIC_WEBSITE_URL}/favicon-16x16.png`,
},
{
rel: "favicon-32x32",
url: `${process.env.WEBSITE_URL}/favicon-32x32.png`,
url: `${process.env.NEXT_PUBLIC_WEBSITE_URL}/favicon-32x32.png`,
},
{
rel: "mstile-150x150",
url: `${process.env.WEBSITE_URL}/mstile-150x150.png`,
url: `${process.env.NEXT_PUBLIC_WEBSITE_URL}/mstile-150x150.png`,
},
{
rel: "safari-pinned-tab",
url: `${process.env.WEBSITE_URL}/safari-pinned-tab.svg`,
url: `${process.env.NEXT_PUBLIC_WEBSITE_URL}/safari-pinned-tab.svg`,
},
],
};
Expand All @@ -95,10 +97,12 @@ export default function RootLayout({
<head>
<meta
name="google-adsense-account"
content={process.env.GOOGLE_ADSENSE_CLIENT_ID}
content={process.env.NEXT_PUBLIC_GOOGLE_ADSENSE_CLIENT_ID}
/>
<Adsense
GOOGLE_ADSENSE_CLIENT_ID={process.env.GOOGLE_ADSENSE_CLIENT_ID}
GOOGLE_ADSENSE_CLIENT_ID={
process.env.NEXT_PUBLIC_GOOGLE_ADSENSE_CLIENT_ID
}
/>
</head>
<body className={inter.className}>
Expand Down
12 changes: 9 additions & 3 deletions docs/src/app/news/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import { AddBanner } from "@/components/Adsense";
import MainBg from "@/components/MainBg";

export default function NewsPage() {
const GOOGLE_ADSENSE_CLIENT_ID = process.env.GOOGLE_ADSENSE_CLIENT_ID ?? "";
const GOOGLE_ADSENSE_CLIENT_ID =
process.env.NEXT_PUBLIC_GOOGLE_ADSENSE_CLIENT_ID ?? "";

const SlotAd1AndAd2 = "9630566447";
const SlotAd3 = "8700628151";
Expand All @@ -24,10 +25,15 @@ export default function NewsPage() {

return (
<MainBg>
<h1>{GOOGLE_ADSENSE_CLIENT_ID} TESTE</h1>
{isClient && (
<>
<div id="news-page" />
<div id="news-page">
<AddBanner
AdClient={GOOGLE_ADSENSE_CLIENT_ID}
AdSlot={SlotAd3}
AdFormat="fluid"
/>
</div>
</>
)}
</MainBg>
Expand Down
6 changes: 1 addition & 5 deletions docs/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import Image from "next/image";
import Link from "next/link";

import translation, { getBrowserLang } from "@/components/Internationalization";
import translation from "@/components/Internationalization";
import MainBg from "@/components/MainBg";
import { merriweather, oswald, playfair, roboto100, sofiaPro } from "@/fonts";

export default function Home() {
const browserLang = getBrowserLang();

console.log("Browser language:", browserLang);

const t = (text: string) => translation({ text, subject: "HomePage" });

return (
Expand Down
2 changes: 1 addition & 1 deletion docs/src/app/robots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { MetadataRoute } from "next";

export default function robots(): MetadataRoute.Robots {
const hostUrl: string =
process.env.WEBSITE_URL ??
process.env.NEXT_PUBLIC_WEBSITE_URL ??
"https://gabriel-logan.github.io/multiform-validator";

return {
Expand Down
2 changes: 1 addition & 1 deletion docs/src/app/sitemap.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { MetadataRoute } from "next";

const hostUrl: string =
process.env.WEBSITE_URL ??
process.env.NEXT_PUBLIC_WEBSITE_URL ??
"https://gabriel-logan.github.io/multiform-validator";

function generateJsMaps(): MetadataRoute.Sitemap {
Expand Down

0 comments on commit 915f12d

Please sign in to comment.