From 7eca4607ca77001252856165dd1f562ab6632a57 Mon Sep 17 00:00:00 2001 From: admin <123@123.com> Date: Sat, 22 Mar 2025 16:11:54 +0800 Subject: [PATCH] Add .gitea/workflows/deploy.yml --- .gitea/workflows/deploy.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .gitea/workflows/deploy.yml diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..b4be97e --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,30 @@ +name: Gitea Actions +run-name: ${{ gitea.actor }} +on: + workflow_dispatch: + +jobs: + Explore-Gitea-Actions: + runs-on: ubuntu-22.04 + steps: + - name: Check out repository code + uses: http://172.23.112.123:3000/actions/checkout@main + - name: List files in the repository + run: | + ls ${{ gitea.workspace }} + - name: Build with Maven using Docker + run: | + docker run --rm -v "$(pwd)":/usr/src/app -v /data/app/maven-repo:/root/.m2/repository -w /usr/src/app maven:3.9.9-eclipse-temurin-17 mvn clean install -Dmaven.test.skip=true + - run: + ls + - name: Configure SSH key + run: | + mkdir -p ~/.ssh + echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa + ssh-keyscan your-server >> ~/.ssh/known_hosts + + - name: Copy JAR to remote server + run: | + scp -o StrictHostKeyChecking=no target/my-app.jar user@your-server:/opt/my-app/my-app.jar + \ No newline at end of file