Skip to content

Commit a5b0672

Browse files
committed
feat: add workflow to create production branch and update dist on every changes
1 parent 4f2d444 commit a5b0672

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

.github/workflows/build.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Build Frontend
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
populate-folder:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout Repository
14+
uses: actions/checkout@v4
15+
with:
16+
persist-credentials: true
17+
fetch-depth: 0
18+
19+
- name: Setup Nodejs
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: 'node'
23+
24+
- name: Change Branch
25+
run: |
26+
git checkout -B production
27+
28+
- name: Cleanup
29+
run: |
30+
rm -rf ./node-modules
31+
rm -rf package.json
32+
rm -rf package-lock.json
33+
34+
- name: Install Dependencies and Build
35+
working-directory: src/quant_research_starter/frontend/cauweb
36+
run: |
37+
rm -rf dist
38+
npm install
39+
npm run build
40+
41+
- name: Prepare Deploy Branch
42+
run: |
43+
git config user.name "github-actions[bot]"
44+
git config user.email "github-actions[bot]@users.noreply.com"
45+
46+
git add .
47+
48+
if git diff --cached --quiet; then
49+
echo "No changes to deploy."
50+
else
51+
git commit -m "deploy: update dist [skip ci]"
52+
git push origin production --force
53+
echo "🚀 Production updated!"
54+
fi
55+
56+
57+

0 commit comments

Comments
 (0)