Files
rosetta-sdu/.gitea/workflows/build.yaml
RoyceDa 830047322a
Some checks failed
Build rosetta-sdu / build (push) Failing after 7s
PORT=7777
2026-02-26 19:28:53 +02:00

63 lines
1.7 KiB
YAML

name: Build rosetta-sdu
on:
push:
branches:
- main
workflow_dispatch:
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
elif command -v apk &> /dev/null; then
sudo apk add --no-cache nodejs npm
fi
- 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: Build with Maven
run: mvn clean package
- name: List build directory
run: ls -la build/
- name: Deploy to server via SSH
uses: appleboy/scp-action@v1
with:
host: ${{ secrets.SDU_SSH_HOST }}
username: ${{ secrets.SDU_SSH_USER }}
password: ${{ secrets.SDU_SSH_PASSWORD }}
port: ${{ secrets.SDU_SSH_PORT }}
source: "build/*"
target: ${{ secrets.SDU_DEPLOY_PATH }}
strip_components: 1
rm: false
debug: true
flatten: true
- name: Restart Docker containers
uses: appleboy/ssh-action@v1.2.5
with:
host: ${{ secrets.SDU_SSH_HOST }}
username: ${{ secrets.SDU_SSH_USER }}
password: ${{ secrets.SDU_SSH_PASSWORD }}
port: ${{ secrets.SDU_SSH_PORT }}
script: |
cd ${{ secrets.SDU_DEPLOY_PATH }}
docker-compose down
PORT=7777 docker compose up -d --build