Skip to content

Commit dc10c3a

Browse files
committed
feature: server build workflow
1 parent f0a748f commit dc10c3a

File tree

3 files changed

+78
-10
lines changed

3 files changed

+78
-10
lines changed

.github/workflows/docker-image.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ name: build docker image
44

55
# Controls when the action will run.
66
on:
7-
push:
8-
branches:
9-
- main
10-
release:
11-
types: [created,published] # 表示在创建新的 Release 时触发
7+
#push:
8+
# branches:
9+
# - main
10+
#release:
11+
# types: [created,published] # 表示在创建新的 Release 时触发
1212

1313
# Allows you to run this workflow manually from the Actions tab
1414
# 可以手动触发

.github/workflows/release.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
name: Release Drafter
22

33
on:
4-
push:
4+
workflow_dispatch:
5+
#push:
56
# branches to consider in the event; optional, defaults to all
6-
branches:
7-
- main
7+
# branches:
8+
# - main
89
# pull_request event is required only for autolabeler
9-
pull_request:
10+
#pull_request:
1011
# Only following types are handled by the action, but one can default to all as well
11-
types: [opened, reopened, synchronize]
12+
# types: [opened, reopened, synchronize]
1213
# pull_request_target event is required for autolabeler to support PRs from forks
1314
# pull_request_target:
1415
# types: [opened, reopened, synchronize]

.github/workflows/server-build.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: huntly server build workflow
2+
3+
on:
4+
# This line enables manual triggering of this workflow.
5+
workflow_dispatch:
6+
7+
defaults:
8+
run:
9+
working-directory: app
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
defaults:
15+
run:
16+
working-directory: app
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v3
21+
22+
- name: Set Node.js 18.7.0
23+
uses: actions/setup-node@v3
24+
with:
25+
node-version: "18.7.9"
26+
cache: "yarn"
27+
cache-dependency-path: "app/client/yarn.lock"
28+
29+
- name: Setup yarn
30+
run: npm install -g yarn --version 1.22.19
31+
32+
- name: Install client dependencies
33+
run: yarn install --frozen-lockfile
34+
35+
- name: Create client bundle
36+
run: yarn build
37+
38+
- name: Set up JDK 11
39+
uses: actions/setup-java@v3
40+
with:
41+
java-version: "11"
42+
distribution: "temurin"
43+
44+
# Retrieve maven dependencies from cache. After a successful run, these dependencies are cached again
45+
- name: Cache maven dependencies
46+
uses: actions/cache@v3
47+
env:
48+
cache-name: cache-maven-dependencies
49+
with:
50+
# maven dependencies are stored in `~/.m2` on Linux/macOS
51+
path: ~/.m2
52+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
53+
restore-keys: ${{ runner.os }}-m2
54+
55+
- name: Build with Maven
56+
run: mvn clean package --file app/server/pom.xml
57+
58+
- name: Move to dist
59+
run: mv app/server/target/huntly-*.jar app/server/dist/
60+
61+
# Upload the build artifact so that it can be used by the test & deploy job in the workflow
62+
- name: Upload server build bundle
63+
uses: actions/upload-artifact@v3
64+
with:
65+
name: server-build
66+
path: app/server/dist/
67+

0 commit comments

Comments
 (0)