-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (43 loc) · 1.43 KB
/
workflow.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
name: Build and Deploy
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add -
sudo add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/
sudo apt-get install -y software-properties-common
sudo apt-get install adoptopenjdk-11-hotspot
- name: Build jar
run: |
./gradlew shadowJar
- name: Deploy to Server
if: github.ref == 'refs/heads/master' && github.repository == 'daltz333/Cynara'
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.PORT }}
source: "build/libs/bot.jar"
target: "/root/"
overwrite: true
strip_components: 2
- name: Restart Server
if: github.ref == 'refs/heads/master' && github.repository == 'daltz333/Cynara'
uses: garygrossgarten/github-action-ssh@release
with:
command: sudo reboot now
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.PORT }}