Skip to content

Commit

Permalink
ci(github-actions): build history github action
Browse files Browse the repository at this point in the history
  • Loading branch information
meodai committed Dec 18, 2023
1 parent eb26950 commit cec4b62
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
42 changes: 42 additions & 0 deletions .github/workflows/update-history.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This will use the script/tools/history.js script to generate a history of the
# repository. This will be used to generate the history page / vizualization.

name: Generate history

on:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [19.x, 18.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm test
- run: npm run build-history
# commit the changes
- name: Commit changes
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add /dist/history.json
git commit -m "Update history.json"
# push the changes
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: master


3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"test": "node scripts/build.js --testOnly",
"clean-dist-folder": "rm -rf dist && mkdir dist",
"build": "npm run clean-dist-folder && node scripts/build.js",
"semantic-release": "semantic-release"
"semantic-release": "semantic-release",
"build-history": "node scripts/tools/history.js > dist/history.json"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit cec4b62

Please sign in to comment.