31 lines
1.0 KiB
YAML
31 lines
1.0 KiB
YAML
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: |
|
|
echo "Current working directory: $(pwd)"
|
|
ls -la $(pwd)
|
|
- 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
|
|
|