-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ 新增(docs-publish.yml):添加GitHub Actions工作流程,自动部署文档 🔧 更新(.gitignore):忽略.next和node_modules文件夹
- Loading branch information
Showing
103 changed files
with
9,642 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Deploy | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'docs/**' | ||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: ./docs | ||
|
||
jobs: | ||
github_pages_deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/cancel-workflow-action@0.9.1 | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js 20.x | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20.x | ||
- name: Install dependencies | ||
run: | | ||
npm install | ||
npm run export | ||
- name: Deploy with gh-pages | ||
run: | | ||
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git | ||
npm run deploy -- -u "github-actions-bot <support+actions@github.com>" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,4 +130,7 @@ dmypy.json | |
# Pyre type checker | ||
.pyre/ | ||
.idea | ||
config.json | ||
config.json | ||
|
||
.next | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.counter { | ||
border: 1px solid #ccc; | ||
border-radius: 5px; | ||
padding: 2px 6px; | ||
margin: 12px 0 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Example from https://beta.reactjs.org/learn | ||
|
||
import { useState } from 'react' | ||
import styles from './counters.module.css' | ||
|
||
function MyButton() { | ||
const [count, setCount] = useState(0) | ||
|
||
function handleClick() { | ||
setCount(count + 1) | ||
} | ||
|
||
return ( | ||
<div> | ||
<button onClick={handleClick} className={styles.counter}> | ||
Clicked {count} times | ||
</button> | ||
</div> | ||
) | ||
} | ||
|
||
export default function MyApp() { | ||
return <MyButton /> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/// <reference types="next" /> | ||
/// <reference types="next/image-types/global" /> | ||
|
||
// NOTE: This file should not be edited | ||
// see https://nextjs.org/docs/basic-features/typescript for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const withNextra = require('nextra')({ | ||
theme: 'nextra-theme-docs', | ||
themeConfig: './theme.config.tsx', | ||
}) | ||
|
||
const isProduction = process.env.NODE_ENV === 'production' | ||
const assetPrefix = isProduction ? '/dailycheckin' : '' | ||
|
||
const nextConfig = { | ||
images: { | ||
unoptimized: true, | ||
}, | ||
reactStrictMode: true, | ||
swcMinify: true, | ||
trailingSlash: true, | ||
assetPrefix, | ||
basePath: assetPrefix, | ||
output: 'export', | ||
} | ||
|
||
module.exports = { | ||
...withNextra(), | ||
...nextConfig, | ||
} |
Oops, something went wrong.