17
17
- uses : webfactory/ssh-agent@v0.7.0
18
18
with :
19
19
ssh-private-key : ${{ secrets.SSH_PRIVATE_KEY }}
20
- - name : Add Know Hosts
20
+ - name : Add Known Hosts
21
21
run : |
22
22
ssh-keyscan -t rsa gitlab.com >> ~/.ssh/known_hosts
23
23
shell : bash
@@ -31,10 +31,13 @@ jobs:
31
31
run : npm run lint:check
32
32
- name : Testing JEST
33
33
run : npm run test
34
+
34
35
release :
35
36
if : github.ref == 'refs/heads/main'
36
37
needs : test
37
38
runs-on : ubuntu-latest
39
+ outputs :
40
+ new_version : ${{ steps.get_version.outputs.VERSION }}
38
41
steps :
39
42
- uses : actions/checkout@v4
40
43
- uses : actions/setup-node@v4
44
47
- uses : webfactory/ssh-agent@v0.7.0
45
48
with :
46
49
ssh-private-key : ${{ secrets.SSH_PRIVATE_KEY }}
47
- - name : Add Know Hosts
50
+ - name : Add Known Hosts
48
51
run : |
49
52
ssh-keyscan -t rsa gitlab.com >> ~/.ssh/known_hosts
50
53
shell : bash
@@ -54,14 +57,17 @@ jobs:
54
57
run : rm -rf node_modules
55
58
- name : Clean install on CI
56
59
run : npm ci
57
- - name : Build library
58
- run : npm run build
59
60
- name : Release version
61
+ id : semantic_release
60
62
run : npx semantic-release@18
61
63
env :
62
64
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
63
65
NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
64
66
67
+ - name : Get new version
68
+ id : get_version
69
+ run : echo "VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
70
+
65
71
build-pages :
66
72
name : Build to GitHub Pages
67
73
needs : release
81
87
- uses : webfactory/ssh-agent@v0.7.0
82
88
with :
83
89
ssh-private-key : ${{ secrets.SSH_PRIVATE_KEY }}
84
- - name : Add Know Hosts
90
+ - name : Add Known Hosts
85
91
run : |
86
92
ssh-keyscan -t rsa gitlab.com >> ~/.ssh/known_hosts
87
93
shell : bash
91
97
run : rm -rf node_modules
92
98
- name : Clean install on CI
93
99
run : npm ci
100
+
94
101
- name : Generate new Build to Pages
95
- run : npm run deploy
102
+ run : VITE_APP_VERSION=${{ needs.release.outputs.new_version }} npm run deploy
103
+
96
104
- name : Upload deploy-ready build files
97
105
uses : actions/upload-artifact@v4
98
106
with :
@@ -118,7 +126,7 @@ jobs:
118
126
- uses : webfactory/ssh-agent@v0.7.0
119
127
with :
120
128
ssh-private-key : ${{ secrets.SSH_PRIVATE_KEY }}
121
- - name : Add Know Hosts
129
+ - name : Add Known Hosts
122
130
run : |
123
131
ssh-keyscan -t rsa gitlab.com >> ~/.ssh/known_hosts
124
132
shell : bash
@@ -129,4 +137,4 @@ jobs:
129
137
GH_TOKEN : eclass:${{ secrets.GITHUB_TOKEN }}
130
138
with :
131
139
github_token : ${{ secrets.GITHUB_TOKEN }}
132
- publish_dir : ./dist
140
+ publish_dir : ./dist
0 commit comments