Skip to content

Commit 6d354c4

Browse files
Prepare deploy gh action
1 parent 743cad8 commit 6d354c4

File tree

2 files changed

+33
-13
lines changed

2 files changed

+33
-13
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: node ./scripts/generate_md.mjs
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

scripts/generate_md.mjs

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
88

99
const generateMd = async () => {
1010
const files = fs.readdirSync(path.resolve(__dirname, '../docs'))
11+
fs.rmdirSync(path.resolve(__dirname, '../docs_md'), { recursive: true })
1112
fs.mkdirSync(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`)

0 commit comments

Comments
 (0)