diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..58b4445 --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,30 @@ +# .gitea/workflows/deploy.yml +name: Deploy TrassenPlaner +run-name: ${{ gitea.actor }} is deploying the application + +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Deploy via SSH + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.DEPLOY_HOST }} + username: ${{ secrets.DEPLOY_USER }} + key: ${{ secrets.DEPLOY_SSH_KEY }} + port: 22 + script: | + # Verzeichnis prüfen und ggf. erstellen oder darin arbeiten + cd /home/${{ secrets.DEPLOY_USER }}/bwscheddebrock_trassenplaner || exit + + git pull origin main + docker compose up -d --build + docker image prune -f