diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..c4f3103 --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,47 @@ + +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 install -y sshpass # Install sshpass for non-interactive SSH authentication + sshpass -p "$DEPLOY_PASSWORD" scp -r build/* "$DEPLOY_USER@$DEPLOY_SERVER:/" + 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/ diff --git a/package-lock.json b/package-lock.json index d3588f3..81f5239 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "0.0.1", "devDependencies": { "@sveltejs/adapter-auto": "^4.0.0", + "@sveltejs/adapter-static": "^3.0.8", "@sveltejs/kit": "^2.16.0", "@sveltejs/vite-plugin-svelte": "^5.0.0", "svelte": "^5.0.0", @@ -819,6 +820,16 @@ "@sveltejs/kit": "^2.0.0" } }, + "node_modules/@sveltejs/adapter-static": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/@sveltejs/adapter-static/-/adapter-static-3.0.8.tgz", + "integrity": "sha512-YaDrquRpZwfcXbnlDsSrBQNCChVOT9MGuSg+dMAyfsAa1SmiAhrA5jUYUiIMC59G92kIbY/AaQOWcBdq+lh+zg==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@sveltejs/kit": "^2.0.0" + } + }, "node_modules/@sveltejs/kit": { "version": "2.20.5", "resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-2.20.5.tgz", diff --git a/package.json b/package.json index 86dc32c..67cbf69 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch" }, "devDependencies": { + "@sveltejs/adapter-static": "^3.0.8", "@sveltejs/adapter-auto": "^4.0.0", "@sveltejs/kit": "^2.16.0", "@sveltejs/vite-plugin-svelte": "^5.0.0", diff --git a/src/routes/+page.js b/src/routes/+page.js new file mode 100644 index 0000000..189f71e --- /dev/null +++ b/src/routes/+page.js @@ -0,0 +1 @@ +export const prerender = true; diff --git a/svelte.config.js b/svelte.config.js index 1295460..4fbc867 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -1,4 +1,4 @@ -import adapter from '@sveltejs/adapter-auto'; +import adapter from '@sveltejs/adapter-static'; import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; /** @type {import('@sveltejs/kit').Config} */