From 1a7903c4ac298bc605905119c5d67cb32d58e2d7 Mon Sep 17 00:00:00 2001 From: Dylan Deng Date: Fri, 18 Oct 2024 19:45:27 +0800 Subject: [PATCH] feat: ci --- .github/workflows/ci.yml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e0233bf --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,39 @@ +name: ci + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '21' + cache: 'maven' + - name: Maven build + run: ./mvnw -Dmaven.test.skip=true clean package + - uses: actions/upload-artifact@v3 + with: + name: evento-lark + path: | + target/*.jar + deploy: + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v3 + with: + name: app + - name: Rename jar + run: mv -v *.jar evento-lark.jar + - name: Deploy + uses: easingthemes/ssh-deploy@main + with: + SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} + REMOTE_HOST: ${{ secrets.REMOTE_HOST }} + REMOTE_USER: evento + SOURCE: evento-lark.jar + TARGET: / \ No newline at end of file