-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (39 loc) · 1.18 KB
/
gitpage.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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