Skip to content

Commit 737568f

Browse files
committed
vitepress
1 parent 1b6b89b commit 737568f

File tree

327 files changed

+21435
-10057
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

327 files changed

+21435
-10057
lines changed

.github/workflows/deploy.yml

+57-42
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,65 @@
1-
name: Build and deploy an updated version of the website
1+
# Sample workflow for building and deploying a Nuxt site to GitHub Pages
2+
#
3+
# To get started with Nuxt see: https://nuxtjs.org/docs/get-started/installation
4+
#
5+
name: Build and publish docs to GitHub Pages
26

37
on:
4-
push
8+
# Runs on pushes targeting the default branch
9+
push:
10+
branches: [vitepress]
11+
12+
# Allows you to run this workflow manually from the Actions tab
13+
workflow_dispatch:
14+
15+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
16+
permissions:
17+
contents: read
18+
pages: write
19+
id-token: write
20+
21+
# Allow one concurrent deployment
22+
concurrency:
23+
group: "pages"
24+
cancel-in-progress: true
525

626
jobs:
27+
# Build job
728
build:
829
runs-on: ubuntu-latest
930
steps:
10-
- name: Checkout CoderBotOrg/docs
11-
uses: actions/checkout@v2
12-
with:
13-
repository: CoderBotOrg/docs
14-
path: folder/repo
15-
lfs: true
31+
- name: Checkout
32+
uses: actions/checkout@v3
33+
- name: Setup Node
34+
uses: actions/setup-node@v3
35+
with:
36+
node-version: "16"
37+
cache: ${{ steps.detect-package-manager.outputs.manager }}
38+
- name: Restore cache
39+
uses: actions/cache@v3
40+
with:
41+
path: |
42+
dist
43+
key: ${{ runner.os }}-build-${{ hashFiles('dist') }}
44+
restore-keys: |
45+
${{ runner.os }}-build-
46+
- name: Install dependencies
47+
run: npm ci
48+
- name: Static HTML export with VitePress
49+
run: npm run docs:build
50+
- name: Upload artifact
51+
uses: actions/upload-pages-artifact@v1
52+
with:
53+
path: ./docs/.vitepress/dist
1654

17-
- name: Checkout CoderBotOrg/docs
18-
uses: actions/checkout@v2
19-
with:
20-
repository: CoderBotOrg/docs
21-
ref: master
22-
path: folder/build
23-
lfs: true
24-
25-
- uses: actions/setup-node@v1
26-
with:
27-
node-version: '12'
28-
29-
- name: Install npm dependencies
30-
working-directory: folder/repo/
31-
run: |
32-
npm install
33-
34-
- working-directory: folder/
35-
run: |
36-
cd repo
37-
npm run build
38-
mkdir dist
39-
cp pages/.vuepress/dist/* dist/ -r
40-
cd ..
41-
cp -a repo/dist/. build/
42-
cd build
43-
mkdir -m 700 ~/.ssh
44-
echo "${{ secrets.SSH_KEY_SECRET }}" > ~/.ssh/id_ed25519
45-
chmod 0600 ~/.ssh/id_ed25519
46-
git config --local user.name "GitHub Action"
47-
git config --global user.email "[email protected]"
48-
echo "docs.coderbot.org" > CNAME
49-
git add .
50-
git commit -m "Update build" && git push || :
55+
# Deployment job
56+
deploy:
57+
environment:
58+
name: github-pages
59+
url: ${{ steps.deployment.outputs.page_url }}
60+
runs-on: ubuntu-latest
61+
needs: build
62+
steps:
63+
- name: Deploy to GitHub Pages
64+
id: deployment
65+
uses: actions/deploy-pages@v1

README.md

+5-55
Original file line numberDiff line numberDiff line change
@@ -13,65 +13,15 @@ npm install
1313

1414
### Deploy
1515

16-
Start a development server with hot reload on `localhost:8080/docs/`:
17-
```bash
18-
npx vuepress dev pages/
19-
```
20-
21-
Production build (destionation: `pages/.vuepress/dist`):
22-
```bash
23-
npx vuepress build pages/
24-
```
25-
26-
Build and deploy on GitHub Pages:
27-
28-
```bash
29-
npm run deploy
30-
```
16+
Push to the **main** branch.
3117

3218
### Development
3319

34-
```
35-
.
36-
├── pages
37-
│ ├── .vuepress (Optional)
38-
│ │ ├── components (Optional)
39-
│ │ ├── theme (Optional)
40-
│ │ │ └── Layout.vue
41-
│ │ ├── public (Optional)
42-
│ │ ├── styles (Optional)
43-
│ │ │ ├── index.styl
44-
│ │ │ └── palette.styl
45-
│ │ ├── templates (Optional, Danger Zone)
46-
│ │ │ ├── dev.html
47-
│ │ │ └── ssr.html
48-
│ │ ├── config.js (Optional)
49-
│ │ └── enhanceApp.js (Optional)
50-
│ │
51-
│ ├── README.md
52-
│ ├── manual
53-
│ │ └── README.md
54-
│ └── anotherpage.md
55-
56-
└── package.json
57-
```
58-
59-
- `pages/.vuepress`: It is used to store global configuration, components, static resources, etc.
60-
- `pages/.vuepress/components`: The Vue components in this directory will be automatically registered as global components.
61-
- `pages/.vuepress/theme`: Used to store local theme.
62-
- `pages/.vuepress/styles`: Stores style related files.
63-
- `pages/.vuepress/styles/index.styl`: Automatically applied global style files, generated at the ending of the CSS file, have a higher priority than the default style.
64-
- `pages/.vuepress/styles/palette.styl`: The palette is used to override the default color constants and to set the color constants of Stylus.
65-
- `pages/.vuepress/public`: Static resource directory.
66-
- `pages/.vuepress/templates`: Store HTML template files.
67-
- `pages/.vuepress/templates/dev.html`: HTML template file for development environment.
68-
- `pages/.vuepress/templates/ssr.html`: Vue SSR based HTML template file in the built time.
69-
- `pages/.vuepress/config.js`: Entry file of configuration, can also be yml or toml.
70-
- `pages/.vuepress/enhanceApp.js`: App level enhancement.
20+
Install node, then run:
7121

72-
Image assets using the $baseURL helper
73-
```html
74-
<img :src="$withBase('/foo.png')" alt="foo">
22+
```
23+
# npm i
24+
# npm run docs:dev
7525
```
7626

7727
### License

docs/.vitepress/cache/deps/@theme_index.js

+41
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/.vitepress/cache/deps/@theme_index.js.map

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"hash": "0d5dc3cb",
3+
"browserHash": "d9c08748",
4+
"optimized": {
5+
"vue": {
6+
"src": "../../../../node_modules/vue/dist/vue.runtime.esm-bundler.js",
7+
"file": "vue.js",
8+
"fileHash": "ad1e1095",
9+
"needsInterop": false
10+
},
11+
"@theme/index": {
12+
"src": "../../../../node_modules/vitepress/dist/client/theme-default/index.js",
13+
"file": "@theme_index.js",
14+
"fileHash": "dad0dd35",
15+
"needsInterop": false
16+
}
17+
},
18+
"chunks": {}
19+
}
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"type":"module"}

0 commit comments

Comments
 (0)