Skip to content

Update gitpage.yml

Update gitpage.yml #53

Workflow file for this run

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.md ./output/index.md
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 "[email protected]"
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