Skip to content

Convert md to html

Convert md to html #9

Workflow file for this run

name: Convert md to html
run-name: Convert md to html
on:
push:
branches: [ main ]
jobs:
Convert-yaml:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.10.11
- name: Download Dependencies
run: |
python -m pip install -U pip
python -m pip install pyyaml
- name: Get File
run: |
cd ${{ github.workspace }}
wget -O ./mindmaps/electricity/convert.py -c https://raw.githubusercontent.com/Nathan3-14/yaml-mindmap/main/convert.py
- name: Execute
run: |
python ./mindmaps/electricity/convert.py ./mindmaps/electricity/electricity.yaml ./output.md
rm ./mindmaps/electricity/convert.py
- name: Git Setup
run: |
git config user.name "GitHub Actions Bot"
git config user.email "[email protected]"
- name: Git Fix
run: |
git rm --cached ./output.md
git reset ./output.md
- name: Git
run: |
git add ./output.md
git commit -m "(action) Updated output.md"
git push
Convert-MD:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '21.6.0'
- name: Install Packages
run: |
npm install markmap-cli
- name: Export Markdown
run: |
npx markmap ./output.md
ls
mv ./output.html ./mindmaps/electricity/index.html
ls ./mindmaps/electricity
rm node_modules -r
rm package.json
rm package-lock.json
- name: Git Fix
run: |
git rm --cached ./mindmaps/electricity/index.html
git reset ./mindmaps/electricity/index.html
- name: Git Setup
run: |
git config user.name "GitHub Actions Bot"
git config user.email "[email protected]"
- name: Git
run: |
git add ./mindmaps/electricity/index.html
git commit -m "(action) Updated index.html"
git push