Skip to content

Commit

Permalink
chore: testing env production
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriel-logan committed May 27, 2024
1 parent 71bdd20 commit 453821f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nextjs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
run: ${{ steps.detect-package-manager.outputs.runner }} next build
env:
TESTE_SECRET: ${{ secrets.TESTE_SECRET }}
TESTE_VAR: ${{ vars.TESTE_VAR }}
NODE_ENV: production
working-directory: ./docs
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
Expand Down
17 changes: 10 additions & 7 deletions docs/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import "./globals.css";

import type { Metadata } from "next";
import { Inter } from "next/font/google";
import Script from "next/script";

import Adsense from "@/components/Adsense";
import Footer from "@/components/Footer";
import Header from "@/components/Header";

Expand Down Expand Up @@ -42,7 +44,7 @@ export const metadata: Metadata = {
"Validator",
"validate",
],
verification: { google: "yJrJTI7i4-7ONpiZoFqwmmFvRs_7HLFSSJlFZQPsNtg" },
verification: { google: process.env.GOOGLE_SEARCH_CONSOLE_API_KEY },
};

export default function RootLayout({
Expand All @@ -53,18 +55,19 @@ export default function RootLayout({
return (
<html lang="en">
<head>
<meta name="google-adsense-account" content="ca-pub-6190451090444284" />
<script
async
src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6190451090444284"
crossOrigin="anonymous"
<meta
name="google-adsense-account"
content={process.env.GOOGLE_ADSENSE_CLIENT_ID}
/>
<Adsense
GOOGLE_ADSENSE_CLIENT_ID={process.env.GOOGLE_ADSENSE_CLIENT_ID}
/>
</head>
<body className={inter.className}>
<Header />
{children}
<Footer />
<script
<Script
data-name="BMC-Widget"
data-cfasync="false"
src="https://cdnjs.buymeacoffee.com/1.0.0/widget.prod.min.js"
Expand Down
2 changes: 0 additions & 2 deletions docs/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import { merriweather, oswald, playfair, roboto100, sofiaPro } from "@/fonts";
export default function Home() {
return (
<MainBg>
<h1 className="text-white">SECRET: {process.env.TESTE_SECRET}</h1>
<h1 className="text-white">VAR: {process.env.TESTE_VAR}</h1>
<h1
className={`mb-6 mt-28 p-2 text-center text-4xl font-semibold text-white ${oswald.className}`}
>
Expand Down
15 changes: 15 additions & 0 deletions docs/src/components/Adsense/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import Script from "next/script";

interface AdsenseProps {
GOOGLE_ADSENSE_CLIENT_ID: string | undefined;
}

export default function Adsense({ GOOGLE_ADSENSE_CLIENT_ID }: AdsenseProps) {
return (
<Script
async
src={`https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=${GOOGLE_ADSENSE_CLIENT_ID}`}
crossOrigin="anonymous"
/>
);
}

0 comments on commit 453821f

Please sign in to comment.