Skip to content

Commit 53db297

Browse files
Add automatic deployment workflow
1 parent 8156330 commit 53db297

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- Master
8+
9+
concurrency:
10+
group: deploy-production
11+
cancel-in-progress: true
12+
13+
jobs:
14+
deploy:
15+
name: Deploy to server
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Deploy over SSH
20+
uses: appleboy/ssh-action@v1.0.3
21+
with:
22+
host: ${{ secrets.DEPLOY_HOST }}
23+
username: ${{ secrets.DEPLOY_USER }}
24+
key: ${{ secrets.DEPLOY_SSH_KEY }}
25+
port: ${{ secrets.DEPLOY_PORT || 22 }}
26+
script: |
27+
set -e
28+
cd "${{ secrets.DEPLOY_PATH }}"
29+
git fetch origin
30+
git checkout "${{ github.ref_name }}"
31+
git pull --ff-only origin "${{ github.ref_name }}"
32+
docker compose up -d --build

0 commit comments

Comments
 (0)