Улучшенный CI/CD
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
name: Build rosetta-wss
|
||||
run-name: Build and Deploy WSS
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
@@ -9,41 +10,22 @@ on:
|
||||
jobs:
|
||||
build:
|
||||
runs-on: java-builders
|
||||
steps:
|
||||
- name: Install Node.js
|
||||
run: |
|
||||
if command -v apt-get &> /dev/null; then
|
||||
sudo apt-get update && sudo apt-get install -y nodejs npm
|
||||
elif command -v brew &> /dev/null; then
|
||||
brew install node
|
||||
fi
|
||||
|
||||
container:
|
||||
image: maven:3.9.9-eclipse-temurin-21
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Set up JDK 21
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '21'
|
||||
distribution: 'temurin'
|
||||
cache: maven
|
||||
- name: Install maven IF not Exists
|
||||
run: |
|
||||
if ! command -v mvn &> /dev/null; then
|
||||
echo "Maven not found, installing..."
|
||||
if command -v apt-get &> /dev/null; then
|
||||
sudo apt-get update && sudo apt-get install -y maven
|
||||
elif command -v brew &> /dev/null; then
|
||||
brew install maven
|
||||
fi
|
||||
else
|
||||
echo "Maven is already installed."
|
||||
fi
|
||||
- name: Build with Maven
|
||||
run: mvn clean package
|
||||
run: mvn -B clean package
|
||||
|
||||
- name: List build directory
|
||||
run: ls -la build/
|
||||
- name: List build artifacts
|
||||
run: |
|
||||
ls -la
|
||||
ls -la target || true
|
||||
ls -la build || true
|
||||
|
||||
- name: Deploy to server via SSH
|
||||
uses: appleboy/scp-action@v1
|
||||
@@ -68,6 +50,5 @@ jobs:
|
||||
port: ${{ secrets.WSS_SSH_PORT }}
|
||||
script: |
|
||||
cd ${{ secrets.WSS_DEPLOY_PATH }}
|
||||
docker-compose down
|
||||
docker compose down
|
||||
docker compose up -d --build
|
||||
|
||||
Reference in New Issue
Block a user