-
Notifications
You must be signed in to change notification settings - Fork 3
46 lines (44 loc) · 1.28 KB
/
gh-pages.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
46
name: website
on:
push:
branches: [main]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install package dependencies
run: yarn
- name: Build Typescript project
run: yarn build
- name: Run Tests to Collect Coverage
run: yarn test
- name: Update Coverage Badge
run: |
mkdir -p website/build/img
npx make-coverage-badge --output-path ./website/build/img/coverage.svg
- name: Release to NPM using Semantic Release
if: ${{ success() }}
uses: cycjimmy/semantic-release-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Build Docusaurus
run: |
cd website
yarn install
yarn build
cd -
- name: Deploy to GitHub Pages
if: ${{ success() }}
uses: crazy-max/ghaction-github-pages@v3
with:
target_branch: gh-pages
build_dir: website/build
keep_history: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}