Update deployment workflow and layout metadata for Next.js application. Added environment variable for site URL in the GitHub Actions workflow and adjusted metadata generation to use this variable. Enhanced icon definitions for better responsiveness in layout.
This commit is contained in:
1 parent
95841ab09a
commit
19fe962143
4 files changed
+24
-7
No files matched your search
@@ -30,6 +30,7 @@ jobs:
|
||||
env:
|
||||
DISABLE_REACT_COMPILER: "1"
|
||||
NEXT_TELEMETRY_DISABLED: "1"
|
||||
NEXT_PUBLIC_SITE_URL: https://aut.insaight.net
|
||||
run: |
|
||||
set -euo pipefail
|
||||
npm ci --no-audit --no-fund
|
||||
@@ -46,16 +47,22 @@ jobs:
|
||||
# Flatten standalone to artifact root (includes .next + node_modules)
|
||||
cp -a .next/standalone/. prebuilt/
|
||||
|
||||
# Static assets + public (required next to standalone)
|
||||
cp -a .next/static prebuilt/.next/static
|
||||
# Next must NOT see a root-level ./static (legacy); only ./.next/static
|
||||
rm -rf prebuilt/static
|
||||
rm -rf prebuilt/.next/static
|
||||
mkdir -p prebuilt/.next
|
||||
cp -a .next/static/. prebuilt/.next/static/
|
||||
|
||||
if [ -d public ]; then
|
||||
rm -rf prebuilt/public
|
||||
cp -a public prebuilt/public
|
||||
else
|
||||
mkdir -p prebuilt/public
|
||||
fi
|
||||
|
||||
# Dockerfile travels with the artifact so deploy context is self-contained
|
||||
# Build recipe for deploy job (excluded from image via .dockerignore)
|
||||
cp Dockerfile.prebuilt prebuilt/Dockerfile
|
||||
printf '%s\n' 'Dockerfile' '.dockerignore' > prebuilt/.dockerignore
|
||||
|
||||
echo "Assembled tree:"
|
||||
ls -la prebuilt
|
||||
@@ -64,6 +71,11 @@ jobs:
|
||||
test -f prebuilt/.next/BUILD_ID
|
||||
test -d prebuilt/.next/static
|
||||
test -d prebuilt/node_modules
|
||||
# Fail if legacy root static leaked in
|
||||
if [ -e prebuilt/static ]; then
|
||||
echo "ERROR: root-level static/ must not exist" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
@@ -102,7 +114,7 @@ jobs:
|
||||
|
||||
# Confirm BUILD_ID is actually inside the image
|
||||
docker run --rm --entrypoint sh "$IMAGE_NAME" -c \
|
||||
'test -f /app/.next/BUILD_ID && test -f /app/server.js && ls -la /app/.next'
|
||||
'test -f /app/.next/BUILD_ID && test -f /app/server.js && test -d /app/.next/static && test ! -e /app/static && ls -la /app && ls -la /app/.next'
|
||||
|
||||
- name: Restart container
|
||||
env:
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 40 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 40 KiB |
+8
-3
@@ -54,17 +54,22 @@ const iranSans = localFont({
|
||||
|
||||
export async function generateMetadata(): Promise<Metadata> {
|
||||
const t = await getTranslations("meta");
|
||||
const siteUrl =
|
||||
process.env.NEXT_PUBLIC_SITE_URL ?? "https://aut.insaight.net";
|
||||
return {
|
||||
metadataBase: new URL("https://openedu.aut.ac.ir"),
|
||||
metadataBase: new URL(siteUrl),
|
||||
title: {
|
||||
default: t("homeTitle"),
|
||||
template: `%s | ${t("homeTitle")}`,
|
||||
},
|
||||
description: t("homeDescription"),
|
||||
icons: {
|
||||
icon: [{ url: "/brand/amirkabir.png", type: "image/png" }],
|
||||
icon: [
|
||||
{ url: "/brand/amirkabir.png", sizes: "32x32", type: "image/png" },
|
||||
{ url: "/brand/amirkabir.png", sizes: "192x192", type: "image/png" },
|
||||
],
|
||||
apple: [{ url: "/brand/amirkabir.png", type: "image/png" }],
|
||||
shortcut: "/brand/amirkabir.png",
|
||||
shortcut: ["/brand/amirkabir.png"],
|
||||
},
|
||||
openGraph: {
|
||||
type: "website",
|
||||
|
||||
Reference in new issue
Block a user