Reapply "FEATURE (deployment): Update deployment to GitHub pages"

This reverts commit bdd2ba3475.
This commit is contained in:
Rostislav Dugin
2025-11-09 17:56:37 +03:00
parent bb9cdc5ffc
commit 0a3bb68cef
7 changed files with 78 additions and 47 deletions

View File

@@ -1,42 +0,0 @@
name: Validate CSS Build
on:
pull_request:
paths:
- 'src/input.css'
- 'index.html'
- '*.html'
- 'tailwind.config.js'
- 'package.json'
workflow_dispatch:
jobs:
validate-css:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build CSS
run: npm run build-css
- name: Check if CSS is up to date
run: |
if ! git diff --quiet styles.min.css; then
echo "❌ styles.min.css is not up to date!"
echo "Please run 'npm run build-css' locally and commit the changes."
git diff styles.min.css
exit 1
else
echo "✅ styles.min.css is up to date!"
fi

59
.github/workflows/deploy.yml vendored Normal file
View File

@@ -0,0 +1,59 @@
name: Deploy Next.js to GitHub Pages
on:
push:
branches:
- website
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: 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:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
- name: Setup Pages
uses: actions/configure-pages@v5
with:
static_site_generator: next
- name: Install dependencies
run: npm ci
- name: Build with Next.js
run: npm run build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./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

View File

@@ -0,0 +1,13 @@
import type { Metadata } from "next";
export const metadata: Metadata = {
robots: "noindex, nofollow",
};
export default function GoogleOAuthLayout({
children,
}: {
children: React.ReactNode;
}) {
return <>{children}</>;
}

View File

@@ -1,11 +1,6 @@
"use client";
import { useEffect } from "react";
import type { Metadata } from "next";
export const metadata: Metadata = {
robots: "noindex, nofollow",
};
export default function GoogleOAuthPage() {
useEffect(() => {

View File

@@ -1,6 +1,11 @@
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
output: "export", // Enable static exports for GitHub Pages
trailingSlash: true, // Ensures proper routing on GitHub Pages
images: {
unoptimized: true, // Required for static export
},
async redirects() {
return [
// Old storage URLs to new structure

0
public/.nojekyll Normal file
View File

1
public/CNAME Normal file
View File

@@ -0,0 +1 @@
postgresus.com