Skip to content

Commit

Permalink
Merge pull request #21 from MuelNova/v2
Browse files Browse the repository at this point in the history
V2
  • Loading branch information
MuelNova authored Sep 30, 2024
2 parents 193ab66 + 35e9120 commit 74af343
Show file tree
Hide file tree
Showing 14 changed files with 768 additions and 415 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ GISCUS_CATEGORY_ID="DIC_kwDOIXU0aM4CXB7m"
GISCUS_LIGHT_CSS="https://oss.nova.gal/css/giscus-light.css"
GISCUS_DARK_CSS="https://oss.nova.gal/css/giscus-dark.css"


# GTAG, can be string array
GTAG="G-XXXXXXXXXX"

Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Deploy to GitHub Pages

on:
push:
branches:
- main
- v2
# Review gh actions docs if you want to further define triggers, paths, etc
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on

jobs:
build:
name: Build Docusaurus
runs-on: ubuntu-latest
environment: gh-pages
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Setup environment variables
run: echo "${{ secrets.ENV_FILE }}" > .env

- name: Build website
run: yarn build

- name: Upload Build Artifact
uses: actions/upload-pages-artifact@v3
with:
path: build

deploy:
name: Deploy to GitHub Pages
needs: build

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
27 changes: 27 additions & 0 deletions .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Test deployment

on:
pull_request:
branches:
- main
- v2
# Review gh actions docs if you want to further define triggers, paths, etc
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on

jobs:
test-deploy:
name: Test deployment
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn

- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Test build website
run: yarn build
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "go-github-webhooks"]
path = go-github-webhooks
url = https://github.com/MuelNova/go-github-webhooks
41 changes: 22 additions & 19 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// dotenv
require("dotenv").config();
import "dotenv/config";

// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
Expand All @@ -26,6 +26,8 @@ const config = {
// If you aren't using GitHub pages, you don't need these.
organizationName: "MuelNova", // Usually your GitHub org/user name.
projectName: "Muel-Nova_Blog", // Usually your repo name.
deploymentBranch: "gh-pages", // The branch your GitHub pages site is deployed from.
trailingSlash: false,

// Even if you don't use internalization, you can use this field to set useful
// metadata like html lang. For example, if your site is Chinese, you may want
Expand Down Expand Up @@ -122,7 +124,8 @@ const config = {
editUrl: "https://github.com/MuelNova/NovaNo1r-Blog/tree/main/",
feedOptions: {
type: "rss",
description: "Nova 是一个做 PWN 的二次元,Nova 的博客用于输出无营养内容。",
description:
"Nova 是一个做 PWN 的二次元,Nova 的博客用于输出无营养内容。",
copyright: `Copyright © ${new Date().getFullYear()} NovaNo1r with ❤`,
},
remarkPlugins: [remarkMath],
Expand Down Expand Up @@ -157,23 +160,23 @@ const config = {
// anonymizeIP: true,
// },
// ],
[
require.resolve("./src/plugins/ai-summary"),
{
OPENAI_API_KEY: process.env.OPENAI_API_KEY,
OPENAI_BASE_URL: process.env.OPENAI_BASE_URL,
OPENAI_SUMMARY_MODEL: process.env.OPENAI_SUMMARY_MODEL,
},
],
[
require.resolve("./src/plugins/ai-translate"),
{
OPENAI_API_KEY: process.env.OPENAI_API_KEY,
OPENAI_BASE_URL: process.env.OPENAI_BASE_URL,
OPENAI_TRANSLATE_MODEL: process.env.OPENAI_TRANSLATE_MODEL,
OPENAI_TOKEN_SIZE: process.env.OPENAI_TOKEN_SIZE,
},
],
// [
// require.resolve("./src/plugins/ai-summary"),
// {
// OPENAI_API_KEY: process.env.OPENAI_API_KEY,
// OPENAI_BASE_URL: process.env.OPENAI_BASE_URL,
// OPENAI_SUMMARY_MODEL: process.env.OPENAI_SUMMARY_MODEL,
// },
// ],
// [
// require.resolve("./src/plugins/ai-translate"),
// {
// OPENAI_API_KEY: process.env.OPENAI_API_KEY,
// OPENAI_BASE_URL: process.env.OPENAI_BASE_URL,
// OPENAI_TRANSLATE_MODEL: process.env.OPENAI_TRANSLATE_MODEL,
// OPENAI_TOKEN_SIZE: process.env.OPENAI_TOKEN_SIZE,
// },
// ],
],

themes: [
Expand Down
1 change: 0 additions & 1 deletion go-github-webhooks
Submodule go-github-webhooks deleted from ec732d
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"typecheck": "tsc"
},
"dependencies": {
"@docusaurus/core": "^3.1.1",
"@docusaurus/plugin-google-gtag": "^3.1.1",
"@docusaurus/preset-classic": "^3.1.1",
"@docusaurus/core": "^3.5.2",
"@docusaurus/plugin-google-gtag": "^3.5.2",
"@docusaurus/preset-classic": "^3.5.2",
"@easyops-cn/docusaurus-search-local": "^0.33.6",
"@giscus/react": "^2.2.8",
"@mdx-js/react": "^3.0.0",
Expand All @@ -40,11 +40,13 @@
"typeit-react": "^2.7.1"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^3.1.1",
"@docusaurus/module-type-aliases": "^3.5.2",
"@docusaurus/tsconfig": "^3.5.2",
"@docusaurus/types": "^3.5.2",
"@tsconfig/docusaurus": "^1.0.5",
"sass": "^1.59.2",
"sass-loader": "^13.2.0",
"typescript": "^4.7.4"
"typescript": "^5.6.2"
},
"browserslist": {
"production": [
Expand Down
Loading

0 comments on commit 74af343

Please sign in to comment.