Skip to content

Commit 18788b6

Browse files
puikinshclaude
andcommitted
Add GitHub Actions deploy workflow for auto-deployment to Hetzner
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b640dae commit 18788b6

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Deploy to Hetzner
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- uses: pnpm/action-setup@v4
14+
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: 24
18+
cache: pnpm
19+
20+
- run: pnpm install --frozen-lockfile
21+
22+
- run: pnpm build
23+
24+
- name: Deploy to server
25+
uses: easingthemes/ssh-deploy@v5
26+
with:
27+
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
28+
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
29+
REMOTE_USER: deploy
30+
SOURCE: build/
31+
TARGET: /var/www/svelteforge/build/
32+
ARGS: -azP --delete
33+
34+
- name: Restart PM2
35+
uses: appleboy/ssh-action@v1
36+
with:
37+
host: ${{ secrets.REMOTE_HOST }}
38+
username: deploy
39+
key: ${{ secrets.SSH_PRIVATE_KEY }}
40+
script: pm2 restart svelteforge

0 commit comments

Comments
 (0)