mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-07-13 11:36:52 +00:00
90 lines
2.8 KiB
YAML
90 lines
2.8 KiB
YAML
name: Deploy Next.js site to Pages
|
|
|
|
on:
|
|
push:
|
|
branches: ["main"]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
pages: write
|
|
id-token: write
|
|
|
|
concurrency:
|
|
group: "pages"
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "20"
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
cd web
|
|
npm install --force
|
|
|
|
- name: Ensure required dependencies are installed
|
|
run: |
|
|
cd web
|
|
npm list next-themes || npm install next-themes
|
|
npm list @radix-ui/react-accordion || npm install @radix-ui/react-accordion
|
|
npm list @radix-ui/react-alert-dialog || npm install @radix-ui/react-alert-dialog
|
|
npm list @radix-ui/react-aspect-ratio || npm install @radix-ui/react-aspect-ratio
|
|
npm list @radix-ui/react-avatar || npm install @radix-ui/react-avatar
|
|
npm list @radix-ui/react-dialog || npm install @radix-ui/react-dialog
|
|
npm list @radix-ui/react-tooltip || npm install @radix-ui/react-tooltip
|
|
npm list @radix-ui/react-switch || npm install @radix-ui/react-switch
|
|
npm list @radix-ui/react-popover || npm install @radix-ui/react-popover
|
|
npm list @radix-ui/react-toast || npm install @radix-ui/react-toast
|
|
|
|
- name: Verify dependencies installation
|
|
run: |
|
|
cd web
|
|
missing=0
|
|
for dep in next-themes @radix-ui/react-accordion @radix-ui/react-alert-dialog @radix-ui/react-aspect-ratio @radix-ui/react-avatar @radix-ui/react-dialog @radix-ui/react-tooltip @radix-ui/react-switch @radix-ui/react-popover @radix-ui/react-toast; do
|
|
if [ ! -d "node_modules/$dep" ]; then
|
|
echo "❌ ERROR: Missing dependency: $dep"
|
|
missing=1
|
|
fi
|
|
done
|
|
if [ "$missing" -eq 1 ]; then
|
|
exit 1
|
|
else
|
|
echo "✅ All required dependencies are installed!"
|
|
fi
|
|
|
|
- name: Build Next.js project
|
|
run: |
|
|
cd web
|
|
npm run build
|
|
|
|
- name: Copy guides and changelog
|
|
run: |
|
|
mkdir -p web/out/guides
|
|
cp -r guides/*.md web/out/guides/ || echo "No guides found"
|
|
cp CHANGELOG.md web/out/ || echo "No CHANGELOG.md found"
|
|
|
|
- name: Upload artifact to GitHub Pages
|
|
uses: actions/upload-pages-artifact@v3
|
|
with:
|
|
path: web/out
|
|
|
|
deploy:
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
steps:
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v4
|