Files
mytimetracker/.gitea/workflows/buildAndDeply.yaml
Nils Burghardt afb869b482
Some checks failed
Build-und-Deploy / build (push) Failing after 21s
Build-und-Deploy / deploy (push) Has been skipped
add pipeline 12
2025-07-13 15:57:12 +02:00

54 lines
1.3 KiB
YAML

name: Build-und-Deploy
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 🧾 Repository auschecken
uses: actions/checkout@v3
- name: 🛠 Baue Projekt ohne Tests
run: |
./gradlew clean build -x test
- name: 📦 Archiviere Build-Artefakt
uses: actions/upload-artifact@v4
with:
name: app-jar
path: build/libs/MyTimeTracker-0.0.1-SNAPSHOT.jar
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: 📥 Lade Artefakt herunter
uses: actions/download-artifact@v4
with:
name: app-jar
- name: 🚀 Deployment via SSH
uses: appleboy/scp-action@v0.1.7
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USER }}
key: ${{ secrets.DEPLOY_KEY }}
source: MyTimeTracker-0.0.1-SNAPSHOT.jar
target: /opt/mytimetracker/build/libs/
- name: 🐳 Starte Compose remote via SSH
uses: appleboy/ssh-action@v1.0.0
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USER }}
key: ${{ secrets.DEPLOY_KEY }}
script: |
cd /opt/mytimetracker
docker compose down
docker compose up -d --build