Skip to content

Commit cec4b62

Browse files
committed
ci(github-actions): build history github action
1 parent eb26950 commit cec4b62

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

.github/workflows/update-history.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# This will use the script/tools/history.js script to generate a history of the
2+
# repository. This will be used to generate the history page / vizualization.
3+
4+
name: Generate history
5+
6+
on:
7+
push:
8+
branches:
9+
- master
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
strategy:
16+
matrix:
17+
node-version: [19.x, 18.x]
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
- name: Use Node.js ${{ matrix.node-version }}
22+
uses: actions/setup-node@v1
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
- run: npm ci
26+
- run: npm test
27+
- run: npm run build-history
28+
# commit the changes
29+
- name: Commit changes
30+
run: |
31+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
32+
git config --local user.name "github-actions[bot]"
33+
git add /dist/history.json
34+
git commit -m "Update history.json"
35+
# push the changes
36+
- name: Push changes
37+
uses: ad-m/github-push-action@master
38+
with:
39+
github_token: ${{ secrets.GITHUB_TOKEN }}
40+
branch: master
41+
42+

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"test": "node scripts/build.js --testOnly",
1111
"clean-dist-folder": "rm -rf dist && mkdir dist",
1212
"build": "npm run clean-dist-folder && node scripts/build.js",
13-
"semantic-release": "semantic-release"
13+
"semantic-release": "semantic-release",
14+
"build-history": "node scripts/tools/history.js > dist/history.json"
1415
},
1516
"repository": {
1617
"type": "git",

0 commit comments

Comments
 (0)