Skip to content

Commit 43383c9

Browse files
Prepare deploy gh action
1 parent 743cad8 commit 43383c9

File tree

3 files changed

+37
-16
lines changed

3 files changed

+37
-16
lines changed

.github/workflows/deploy.yml

+32-13
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,38 @@ jobs:
77
build-and-deploy:
88
runs-on: ubuntu-latest
99
steps:
10-
- name: Checkout 🛎️
11-
uses: actions/checkout@v3
10+
- name: Checkout
11+
uses: actions/checkout@v4
1212

13-
- name: Install dependencies
14-
run: |
15-
sudo apt-get install -y python3-sphinx python3-sphinx-rtd-theme
16-
17-
- name: Build
18-
run: |
19-
cd docs && make html
13+
- name: Install pandoc
14+
uses: pandoc/actions/setup@v1
15+
with:
16+
version: 3.5
2017

21-
- name: Deploy
22-
uses: JamesIves/github-pages-deploy-action@v4.3.3
18+
- name: Setup Node
19+
uses: actions/setup-node@v4
2320
with:
24-
branch: gh-pages
25-
folder: docs/_build/html
21+
node-version: 20
22+
cache: npm
23+
24+
- name: Build md files
25+
run: npm run pandoc:build
26+
27+
- name: Show status
28+
run: git status
29+
30+
# - name: Install dependencies
31+
# run: npm ci
32+
#
33+
# - name: Build with VitePress
34+
# run: npm run docs:build
35+
36+
# - name: Build
37+
# run: |
38+
# cd docs && make html
39+
40+
# - name: Deploy
41+
# uses: JamesIves/[email protected]
42+
# with:
43+
# branch: gh-pages
44+
# folder: docs/_build/html

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"test": "echo \"Error: no test specified\" && exit 1",
77
"docs:dev": "vitepress dev",
88
"docs:build": "vitepress build",
9-
"docs:preview": "vitepress preview"
9+
"docs:preview": "vitepress preview",
10+
"pandoc:build": "node ./scripts/generate_md.mjs"
1011
},
1112
"repository": {
1213
"type": "git",

scripts/generate_md.mjs

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ import { fileURLToPath } from 'node:url';
77
const __dirname = dirname(fileURLToPath(import.meta.url));
88

99
const generateMd = async () => {
10-
const files = fs.readdirSync(path.resolve(__dirname, '../docs'))
11-
fs.mkdirSync(path.resolve(__dirname, '../docs_md'))
10+
const files = await fs.promises.readdir(path.resolve(__dirname, '../docs'))
11+
await fs.promises.rm(path.resolve(__dirname, '../docs_md'), { recursive: true, force: true })
12+
fs.promises.mkdir(path.resolve(__dirname, '../docs_md'))
1213
for await (const file of files) {
1314
execSync(`pandoc --lua-filter=${__dirname}/pandoc_fix_links.lua -s ${__dirname}/../docs/${file} -o ${__dirname}/../docs_md/${path.parse(file).name}.md -t gfm`)
1415
}

0 commit comments

Comments
 (0)