Skip to content

Commit 5482250

Browse files
committed
chore: update ci and add demo page
1 parent ca1feed commit 5482250

File tree

2 files changed

+782
-4
lines changed

2 files changed

+782
-4
lines changed

.github/workflows/gitpage.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: CI
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [ main, v2 ]
66
pull_request:
77
branches: [ main ]
88

@@ -18,17 +18,33 @@ jobs:
1818
- name: build and test
1919
run: |
2020
npm ci
21-
tsc
21+
npm run build
22+
23+
- name: generate example page by hmd2html cli
2224
node dist/cli.js -i ./example/index.md
2325
node dist/cli.js -i ./example/index.md -k -o ./output/index.dark.html
24-
- name: commit and push
26+
27+
- name: generate example page by web js
28+
run: |
29+
mkdir output/js
30+
cp ./dist/web/hmd2html.min.js ./output/js
31+
cp ./example/index.md ./output/index.md
32+
cp ./example/index.html ./output/webjs.html
33+
34+
- name: Check for changes
35+
id: check_changes
2536
run: |
2637
cd output
2738
git init
2839
git config user.name "CI"
2940
git config user.email "nodejs-ci@github.com"
30-
git remote add secure-origin https://${{ secrets.NPM_CI }}@github.com/liao2000/${{ github.event.repository.name }}
41+
git remote add secure-origin https://${{ secrets.NPM_CI }}@github.com/ksw2000/${{ github.event.repository.name }}
3142
git checkout -b gh-pages
43+
git diff --exit-code || echo "Changes detected"
44+
45+
- name: commit and push
46+
if: steps.check_changes.outputs.exit-code != 0
47+
run:
3248
git add .
3349
git commit -m "Generated by CI"
3450
git push --force secure-origin gh-pages

0 commit comments

Comments
 (0)