-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (38 loc) · 1.05 KB
/
deploy.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
name: Deploy to Amazon EC2
on:
push:
branches: [ "develop" ]
jobs:
deploy:
name: deploy
runs-on: ubuntu-latest
environment: production
steps:
- name: setting-jdk17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'zulu'
- name: checkout
uses: actions/checkout@v2
#
# - name: test
# run: ./gradlew clean test
- name : build
run: ./gradlew build -x test
- name: copy file to Develop server via ssh key
uses: appleboy/[email protected]
with:
host: ${{ secrets.AWS_HOST }}
username: ${{ secrets.AWS_USERNAME }}
key: ${{ secrets.AWS_SSH_KEY }}
source: "build/libs/*"
target: "/home/ubuntu/apiserver"
- name: deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.AWS_HOST }}
username: ${{ secrets.AWS_USERNAME }}
key: ${{ secrets.AWS_SSH_KEY }}
script: |
sudo systemctl restart apiserver.service