name: Build and Deploy Svelte App on: push: branches: - main # Trigger the action on push to the main branch jobs: build-and-deploy: runs-on: ubuntu-latest steps: # Check out the repository - name: Checkout Repository uses: actions/checkout@v2 # Set up Node.js - name: Set up Node.js uses: actions/setup-node@v2 with: node-version: '23' # You can adjust the Node.js version if needed # Install dependencies - name: Install Dependencies run: | npm install # Build the Svelte app - name: Build the Svelte app run: | npm run build # Deploy the build to your server (e.g., using SCP, Rsync, or FTP) - name: Deploy to Strato.de (SFTP example) run: | sudo apt-get update # Update package list sudo apt-get install -y sshpass # Install sshpass for non-interactive SFTP echo "putting files to Strato server" sshpass -p "$DEPLOY_PASSWORD" sftp -o StrictHostKeyChecking=no "$DEPLOY_USER@$DEPLOY_SERVER:/" <