-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (69 loc) · 2.38 KB
/
build.yml
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
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Test
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
environment: Production
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Make gradlew executable
working-directory: ./todo-service
run: chmod +x ./gradlew
- name: Build with Gradle
id: gradle
working-directory: ./todo-service
run: ./gradlew build
# - name: Upload Test Report to Server
# if: github.ref == 'refs/heads/main'
# uses: wlixcc/[email protected]
# with:
# server: '${{ secrets.SERVER }}'
# username: 'ubuntu'
# ssh_private_key: '${{ secrets.SSH_PRIVATE_KEY }}'
# local_path: './todo-service/build/reports/jacoco/test/html/*'
# remote_path: '/home/ubuntu/todo/code-coverage'
# args: '-o ConnectTimeout=5'
# - name: Upload Jar to Server
# if: github.ref == 'refs/heads/main'
# uses: wlixcc/[email protected]
# with:
# server: '${{ secrets.SERVER }}'
# username: 'ubuntu'
# ssh_private_key: '${{ secrets.SSH_PRIVATE_KEY }}'
# local_path: './todo-service/build/libs/todo-service-*-SNAPSHOT.jar'
# remote_path: '/home/ubuntu/todo/todo-service'
# args: '-o ConnectTimeout=5'
# - name: Build and Run Service
# if: github.ref == 'refs/heads/main'
# uses: appleboy/[email protected]
# with:
# host: '${{ secrets.SERVER }}'
# username: 'ubuntu'
# key: '${{ secrets.SSH_PRIVATE_KEY }}'
# script: |
# cd /home/ubuntu/todo/todo-service
# ./quick.sh build
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: lts/*
- name: npm install
working-directory: ./todo-web
run: npm install
- name: npm run test
working-directory: ./todo-web
run: npm run test
- name: npm run build
working-directory: ./todo-web
run: npm run build