This commit is contained in:
blu3berryys 2025-04-30 13:32:07 +03:00
commit 2ea651d4af
2 changed files with 17 additions and 41 deletions

View file

@ -1,90 +1,66 @@
# Sample workflow for building and deploying a Next.js site to GitHub Pages name: Deploy Zen Docs
#
# To get started with Next.js see: https://nextjs.org/docs/getting-started
#
name: Deploy Next.js site to Pages
on: on:
# Runs on pushes targeting the default branch
push: push:
branches: ["main"] branches: ["main"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch: workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions: permissions:
contents: read contents: read
pages: write pages: write
id-token: write id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency: concurrency:
group: "pages" group: "pages"
cancel-in-progress: false cancel-in-progress: false
jobs: jobs:
# Build job
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Detect package manager
id: detect-package-manager - name: Setup Node.js
run: |
if [ -f "${{ github.workspace }}/package.json" ]; then
echo "manager=npm" >> $GITHUB_OUTPUT
echo "command=install" >> $GITHUB_OUTPUT
echo "runner=npx --no-install" >> $GITHUB_OUTPUT
exit 0
else
echo "Unable to determine package manager"
exit 1
fi
- name: Setup Node
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: "20" node-version: "22"
cache: ${{ steps.detect-package-manager.outputs.manager }} cache: "npm"
cache-dependency-path: "package.json" cache-dependency-path: "package.json"
check-latest: true check-latest: true
- name: Setup Pages
- name: Setup GitHub Pages
uses: actions/configure-pages@v5 uses: actions/configure-pages@v5
# with:
# Automatically inject basePath in your Next.js configuration file and disable
# server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized).
#
# You may remove this line if you want to manage the configuration yourself.
# static_site_generator: next
- name: Restore cache - name: Restore cache
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
path: | path: |
.next/cache .next/cache
node_modules node_modules
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('package.json') }} key: ${{ runner.os }}-nextjs-${{ hashFiles('package.json') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: | restore-keys: |
${{ runner.os }}-nextjs- ${{ runner.os }}-nextjs-
- name: Install dependencies - name: Install dependencies
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }} run: npm install
- name: Build with Next.js - name: Build with Next.js
run: ${{ steps.detect-package-manager.outputs.runner }} next build run: npx --no-install next build
- name: Upload artifact - name: Upload artifact
uses: actions/upload-pages-artifact@v3 uses: actions/upload-pages-artifact@v3
with: with:
path: ./out path: ./out
# Deployment job
deploy: deploy:
environment: environment:
name: github-pages name: github-pages
url: ${{ steps.deployment.outputs.page_url }} url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build needs: build
steps: steps:
- name: Deploy to GitHub Pages - name: Deploy to GitHub Pages
id: deployment id: deployment

View file

@ -1,4 +1,4 @@
import { buttonVariants } from "fumadocs-ui/components/api"; import { buttonVariants } from "fumadocs-ui/components/ui/button";
import Image from "next/image"; import Image from "next/image";
import Link from "next/link"; import Link from "next/link";
import type { Metadata } from "next"; import type { Metadata } from "next";