FitLog/.gitea/workflows/deploy.yml
itsscb 6ccb37b556
All checks were successful
Build and Deploy Svelte App / build-and-deploy (push) Successful in 1m2s
fix: host key verification failed
2025-04-09 23:42:50 +02:00

54 lines
1.7 KiB
YAML

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:/" <<EOF
cd /path/to/your/website # Change to the directory where you want to upload files
put -r build/* # Upload the contents of the build folder
exit # Close the SFTP session
EOF
env:
DEPLOY_PASSWORD: ${{ secrets.STRATO_PASSWORD }} # Add your deployment password to secrets
DEPLOY_USER: ${{ secrets.STRATO_USER }} # Add your deploy username to secrets
DEPLOY_SERVER: ${{ secrets.STRATO_SERVER }} # Add your deploy server address to secrets
# Clean up if necessary (optional step)
- name: Clean up
run: |
rm -rf build/