Skip to content

Commit b83f405

Browse files
dazy-dsmhordynski
andcommitted
feat: automated UI build (#784)
Co-authored-by: Mateusz Hordyński <[email protected]>
1 parent 5e7d33f commit b83f405

File tree

3 files changed

+79
-8
lines changed

3 files changed

+79
-8
lines changed

.github/workflows/build-ui.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Automated UI build
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
# UI build is triggered only for `develop` branch, as the commits are carried to main
8+
- develop
9+
paths:
10+
- typescript/ui/**
11+
12+
jobs:
13+
build:
14+
name: Build & commit UI
15+
continue-on-error: false
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: write
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Set up Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: "lts/*"
26+
27+
- name: Install TypeScript dependencies
28+
run: npm ci
29+
30+
- name: Build packages
31+
run: npm run build
32+
33+
- name: Configure Git
34+
run: |
35+
git config user.name "ds-ragbits-robot"
36+
git config user.email "[email protected]"
37+
38+
- name: Commit UI
39+
run: |
40+
git add packages/ragbits-chat/src/ragbits/chat/ui-build
41+
git commit -m "Automated UI build"
42+
git push origin HEAD
43+
env:
44+
GH_TOKEN: ${{ secrets.GH_TOKEN }}

.github/workflows/publish-npm.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Publish NPM packages
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish-npm:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- name: Set up Node.js
14+
uses: actions/setup-node@v4
15+
with:
16+
node-version: "lts/*"
17+
registry-url: "https://registry.npmjs.org"
18+
19+
- name: Install TypeScript dependencies
20+
run: npm ci
21+
22+
- name: Build packages
23+
run: npm run build:packages
24+
25+
- name: Publish @ragbits/api-client
26+
run: npm publish --provenance --access public
27+
working-directory: typescript/@ragbits/api-client
28+
env:
29+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
30+
31+
- name: Publish @ragbits/api-client-react
32+
run: npm publish --provenance --access public
33+
working-directory: typescript/@ragbits/api-client-react
34+
env:
35+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/shared-ui.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,6 @@ jobs:
5959
run: npm run build
6060
working-directory: typescript/ui
6161

62-
- name: Check Ragbits Chat UI build sync
63-
run: |
64-
git diff --quiet * || {
65-
echo "ragbits-chat package ui build not synced"
66-
exit 1
67-
}
68-
working-directory: typescript/ui
69-
7062
- name: Run unit tests
7163
run: npm run test:run
7264
working-directory: typescript/ui

0 commit comments

Comments
 (0)