This repository was archived by the owner on Apr 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (47 loc) · 1.48 KB
/
main.yml
File metadata and controls
51 lines (47 loc) · 1.48 KB
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
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: build
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 16
uses: actions/setup-java@v2
with:
java-version: '16'
distribution: 'adopt'
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: upload artifact jarfile
uses: actions/upload-artifact@v2
with:
name: jarfile only
path: target/Metaverseplugin.jar
- name: upload artifact target
uses: actions/upload-artifact@v2
with:
name: target dir
path: target/*
deploy:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/download-artifact@master
with:
name: jarfile only
path: ./
- name: deploy file
uses: wlixcc/SFTP-Deploy-Action@v1.2.1
with:
username: ${{ secrets.SSH_USERNAME }}
server: ${{ secrets.SSH_SERVER }}
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
local_path: './Metaverseplugin.jar'
remote_path: '/var/minecraft/plugins/'
args: '-o ConnectTimeout=5'