From 0a5921b66dc0634f3a5ce76e1e83cc7eb654ef83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=B5=B7?= <34731503+xiaohai2271@users.noreply.github.com> Date: Fri, 17 Apr 2020 11:09:48 +0800 Subject: [PATCH] add github ci --- .github/workflows/mavenpublish.yml | 43 ++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/mavenpublish.yml diff --git a/.github/workflows/mavenpublish.yml b/.github/workflows/mavenpublish.yml new file mode 100644 index 0000000..a9e36f5 --- /dev/null +++ b/.github/workflows/mavenpublish.yml @@ -0,0 +1,43 @@ +# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created +# For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path + +name: Maven Package + +on: + release: + types: [created] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + + - name: Build jar file + run: mvn -B package --file pom.xml + + - name: scp + uses: horochx/deploy-via-scp@v1.0.1 + with: + local: target/blog-0.0.1-SNAPSHOT.jar + remote: /www/wwwroot/api.celess.cn + host: ${{ secrets.SSH_HOST }} + username: ${{ secrets.SSH_USERNAME }} + password: ${{ secrets.SSH_PASSWORD }} + port: ${{ secrets.SSH_PORT }} + + - name: Run SSH command + uses: garygrossgarten/github-action-ssh@v0.5.0 + with: + command: cd /www/wwwroot/api.celess.cn && bash build.sh + host: ${{ secrets.SSH_HOST }} + username: ${{ secrets.SSH_USERNAME }} + password: ${{ secrets.SSH_PASSWORD }} + port: ${{ secrets.SSH_PORT }} +