Skip to content

Commit c44a116

Browse files
copilot code convertMarkDownToHtml.yml github action
1 parent 895baad commit c44a116

File tree

2 files changed

+33
-36
lines changed

2 files changed

+33
-36
lines changed

.github/workflows/blank.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Convert MarkDown To Html
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout repository
12+
uses: actions/checkout@v3
13+
14+
- name: Set up Python
15+
uses: actions/setup-python@v4
16+
with:
17+
python-version: '3.x'
18+
19+
- name: Install markdown package
20+
run: pip install markdown
21+
22+
- name: Convert README.md to HTML
23+
run: |
24+
mkdir -p page
25+
python -c "import markdown, pathlib; html = markdown.markdown(pathlib.Path('README.md').read_text()); pathlib.Path('page/index.html').write_text(html)"
26+
27+
- name: Commit and push index.html
28+
run: |
29+
git config --global user.name 'github-actions[bot]'
30+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
31+
git add page/index.html
32+
git commit -m 'Auto-generate index.html from README.md' || echo 'No changes to commit'
33+
git push

0 commit comments

Comments
 (0)