Skip to content

Commit

Permalink
Merge dbf5367 into 490f5cd
Browse files Browse the repository at this point in the history
  • Loading branch information
Wxh16144 authored Mar 5, 2023
2 parents 490f5cd + dbf5367 commit 398ba27
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 3 deletions.
10 changes: 9 additions & 1 deletion .dumirc.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
// more config: https://d.umijs.org/config
import { defineConfig } from 'dumi';

const name = 'cssinjs';

const isProdSite =
// 不是预览模式 同时是生产环境
process.env.PREVIEW !== 'true' && process.env.NODE_ENV === 'production';

export default defineConfig({
favicons: ['https://avatars0.githubusercontent.com/u/9441414?s=200&v=4'],
themeConfig: {
name: 'cssinjs',
name,
logo: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
},
outputPath: '.doc',
exportStatic: {},
base: isProdSite ? `/${name}/` : '/',
publicPath: isProdSite ? `/${name}/` : '/',
});
2 changes: 1 addition & 1 deletion .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ jobs:
dist: .doc
build: |
npm install
npm run docs:build
npm run docs:preview
- name: Get the preview_url
run: echo "url => ${{ steps.preview_step.outputs.preview_url }}"
39 changes: 39 additions & 0 deletions .github/workflows/site-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Deploy website
on:
push:
tags:
- '*'
workflow_dispatch:

permissions:
contents: write

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3

- name: setup node
uses: actions/setup-node@v1
with:
node-version: 14

- name: create package-lock.json
run: npm i --package-lock-only --ignore-scripts

- name: Install dependencies
run: npm ci

- name: build Docs
run: npm run docs:build

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./.doc
force_orphan: true
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
"start": "dumi dev",
"docs:build": "dumi build",
"docs:deploy": "gh-pages -d .doc",
"docs:preview": "PREVIEW=true npm run docs:build",
"compile": "father build",
"gh-pages": "npm run docs:build && npm run docs:deploy",
"gh-pages": "npm run docs:build",
"prepublishOnly": "npm run compile && np --yolo --no-publish",
"postpublish": "npm run gh-pages",
"lint": "eslint src/ --ext .ts,.tsx,.jsx,.js,.md",
Expand Down

0 comments on commit 398ba27

Please sign in to comment.