name: CI/CD Cloud Deployment on: push: branches: [ "main" ] pull_request: branches: [ "main" ] jobs: test-and-build: runs-on: ubuntu-latest steps: - name: Checkout Repository uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '22' - name: Run Self-Tests run: | npm test - name: Build Docker Image run: | docker build -t luneraria-control-center:${{ github.sha }} . docker tag luneraria-control-center:${{ github.sha }} luneraria-control-center:latest # Optional: Push to Docker Hub or Cloud Container Registry # - name: Deploy to Cloud VPS (Beispiel via SSH / Docker Compose) # uses: appleboy/ssh-action@v1.0.0 # with: # host: ${{ secrets.CLOUD_SERVER_HOST }} # username: ${{ secrets.CLOUD_SERVER_USER }} # key: ${{ secrets.CLOUD_SERVER_SSH_KEY }} # script: | # cd /opt/luneraria # git pull origin main # docker compose up -d --build