fix: gitpage doesn't support hackmd markdown #54
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ main, v2 ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
gitpage: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: 16 | |
- name: build and test | |
run: | | |
npm ci | |
npm run build | |
- name: generate example page by hmd2html cli | |
run: | | |
node dist/cli.js -i ./example/index.md | |
node dist/cli.js -i ./example/index.md -k -o ./output/index.dark.html | |
- name: generate example page by web js | |
run: | | |
mkdir output/js | |
mv ./dist/web/hmd2html.min.js ./output/js | |
mv ./example/index.html ./output/webjs.html | |
- name: commit and push | |
id: check_changes | |
run: | | |
cd output | |
git init | |
git config user.name "CI" | |
git config user.email "nodejs-ci@github.com" | |
git remote add secure-origin https://${{ secrets.NPM_CI }}@github.com/ksw2000/${{ github.event.repository.name }} | |
git checkout -b gh-pages | |
git add . | |
git commit -m "Generated by CI" | |
git push -f secure-origin gh-pages |