diff --git a/.env.example b/.env.example deleted file mode 100644 index 3da5cbe..0000000 --- a/.env.example +++ /dev/null @@ -1 +0,0 @@ -BASE_PATH=/Next.js-and-GitHub-Pages-Example \ No newline at end of file diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 52f2dea..fc52ad8 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -22,6 +22,9 @@ jobs: - name: Installing my packages run: npm ci + - name: Extract repository name + run: echo "BASE_URL=$(echo $GITHUB_REPOSITORY | cut -d '/' -f 2)" >> $GITHUB_ENV + - name: Build my App run: npm run build && touch ./out/.nojekyll diff --git a/.gitignore b/.gitignore index a276a84..737d872 100644 --- a/.gitignore +++ b/.gitignore @@ -33,5 +33,3 @@ yarn-error.log* # typescript *.tsbuildinfo - -.env diff --git a/next.config.mjs b/next.config.mjs index 2f86332..34662df 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -7,6 +7,7 @@ const nextConfig = { loader: "akamai", path: "", }, + assetPrefix: "./", }; export default nextConfig; diff --git a/pages/index.tsx b/pages/index.tsx index 59e6f8a..411cbcb 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -2,6 +2,7 @@ import type { NextPage } from "next"; import Head from "next/head"; import Image from "next/image"; import styles from "../styles/Home.module.css"; +import { prefix } from "../utils/prefix"; const Home: NextPage = () => { return ( @@ -9,7 +10,7 @@ const Home: NextPage = () => { Create Next App - +
@@ -62,7 +63,7 @@ const Home: NextPage = () => { Powered by{" "}