Skip to content

Commit

Permalink
chore: update ci and add demo page
Browse files Browse the repository at this point in the history
  • Loading branch information
ksw2000 committed Nov 9, 2024
1 parent ca1feed commit 5482250
Show file tree
Hide file tree
Showing 2 changed files with 782 additions and 4 deletions.
24 changes: 20 additions & 4 deletions .github/workflows/gitpage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI

on:
push:
branches: [ main ]
branches: [ main, v2 ]
pull_request:
branches: [ main ]

Expand All @@ -18,17 +18,33 @@ jobs:
- name: build and test
run: |
npm ci
tsc
npm run build
- name: generate example page by hmd2html cli
node dist/cli.js -i ./example/index.md
node dist/cli.js -i ./example/index.md -k -o ./output/index.dark.html
- name: commit and push

- name: generate example page by web js
run: |
mkdir output/js
cp ./dist/web/hmd2html.min.js ./output/js
cp ./example/index.md ./output/index.md
cp ./example/index.html ./output/webjs.html
- name: Check for changes
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/liao2000/${{ github.event.repository.name }}
git remote add secure-origin https://${{ secrets.NPM_CI }}@github.com/ksw2000/${{ github.event.repository.name }}
git checkout -b gh-pages
git diff --exit-code || echo "Changes detected"
- name: commit and push
if: steps.check_changes.outputs.exit-code != 0
run:
git add .
git commit -m "Generated by CI"
git push --force secure-origin gh-pages
Loading

0 comments on commit 5482250

Please sign in to comment.