-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (54 loc) · 1.57 KB
/
build.yaml
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
name: Build React Library
on:
push:
branches: [ main, Storybook ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '23'
- name: Install dependencies
run: npm ci
- name: Build library
run: |
npm run generate:css
ls -al
npm run build
# Create .gitignore file excluding dist folder
echo -e "!dist\n!dist/*" >> .gitignore
- name: Commit built files
run: |
cat .gitignore
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
# Add dist folder contents
git add dist/
# Only commit if there are changes
if git diff --cached --quiet ; then
echo "No changes in dist folder"
else
git commit -m "Automated build: Update dist folder"
git push origin Storybook
fi
version-tag:
needs: build
if: needs.build.result == 'success'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: prepare
run: echo ignore_merge_commits = true" > cog.toml
- name: Create Version Tag
uses: cocogitto/cocogitto-action@v3
with:
release: true
git-user: 'Cocogitto bot'
check-latest-tag-only: true