Skip to content

Commit

Permalink
feat: deploy to github pages
Browse files Browse the repository at this point in the history
  • Loading branch information
anig1scur committed Oct 30, 2024
1 parent 7b40900 commit ccf79ca
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 10 deletions.
11 changes: 9 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{
"extends": ["next/core-web-vitals", "next/typescript"]
}
"extends": [
"next/core-web-vitals",
"next/typescript"
],
"rules": {
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-explicit-any": "off"
}
}
53 changes: 53 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Deploy Next.js site to Pages

on:
push:
branches: ["main"]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: 'pnpm'

- name: Setup Pages
uses: actions/configure-pages@v4

- name: Install dependencies
run: pnpm i

- name: Build with Next.js
run: pnpm 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
7 changes: 6 additions & 1 deletion next.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import type { NextConfig } from "next";
import type {NextConfig} from 'next';

const nextConfig: NextConfig = {
/* config options here */
output: 'export',
basePath: process.env.NODE_ENV === 'production' ? '/fcitx5-theme-designer' : '',
images: {
unoptimized: true,
},
};

export default nextConfig;
14 changes: 7 additions & 7 deletions src/components/ui/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ import * as React from "react"

import { cn } from "@/lib/utils"

export interface InputProps
extends React.InputHTMLAttributes<HTMLInputElement> {}
/* eslint-disable @typescript-eslint/no-empty-object-type */
export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> { }

const Input = React.forwardRef<HTMLInputElement, InputProps>(
({ className, type, ...props }, ref) => {
return (
<input
type={type}
className={cn(
type={ type }
className={ cn(
"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
className
)}
ref={ref}
{...props}
) }
ref={ ref }
{ ...props }
/>
)
}
Expand Down

0 comments on commit ccf79ca

Please sign in to comment.