Skip to content

Commit e33cb2e

Browse files
authored
Add GitHub Actions workflow for deployment on release
1 parent 6ac7e74 commit e33cb2e

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Deploy on Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Deploy via SSH
12+
uses: appleboy/ssh-action@v1.0.3
13+
with:
14+
host: ${{ secrets.SSH_HOST }}
15+
username: ${{ secrets.SSH_USER }}
16+
key: ${{ secrets.SSH_KEY }}
17+
port: ${{ secrets.SSH_PORT || 22 }}
18+
script: |
19+
set -e
20+
cd /var/www/myapp
21+
git fetch --tags --force
22+
git checkout ${{ github.event.release.tag_name }}
23+
# build/installeer (pas aan op jouw stack)
24+
npm ci
25+
npm run build
26+
pm2 reload myapp || pm2 start npm --name myapp -- start

0 commit comments

Comments
 (0)