-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (91 loc) · 2.51 KB
/
main.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: main
on:
push:
branches-ignore:
- gh-pages
jobs:
commitlint:
name: Lint Commit Messages
runs-on: ubuntu-latest
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v5
test-and-build:
name: Build & Test
runs-on: ubuntu-latest
needs: commitlint
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm install
- name: TypeScript Check
run: npm run type-check
- name: ESLint Check
run: npm run lint
- name: Test
run: npm run test
- name: Build
run: npm run build
- name: 'Upload build artifact'
uses: actions/upload-artifact@v4
with:
name: dist
path: dist
release:
name: Release
runs-on: ubuntu-latest
needs: test-and-build
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: 'Prepare: Bump version and push tag'
id: changelog
uses: TriPSs/conventional-changelog-action@v5
with:
github-token: ${{secrets.GITHUB_TOKEN}}
skip-on-empty: 'true'
output-file: 'false'
git-message: 'chore(release): {version}'
tag-prefix: 'v'
- name: 'Release: Create Release on Github'
if: ${{ steps.changelog.outputs.skipped != 'true' && steps.changelog.outputs.tag != ''}}
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
tag_name: ${{ steps.changelog.outputs.tag }}
body: ${{ steps.changelog.outputs.clean_changelog }}
draft: false
prerelease: false
deploy:
name: Deploy
runs-on: ubuntu-latest
needs: release
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: npm run build
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@releases/v4
with:
branch: gh-pages
folder: ./dist
target-folder: .