Skip to content

Commit e9d601f

Browse files
authored
Add GitHub Actions workflow for Docker deploy
1 parent e246cf5 commit e9d601f

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

.github/workflows/main.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Deploy to Production
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: rsync deployments
14+
uses: burnett01/rsync-deployments@7.1.0
15+
with:
16+
switches: -avzr --delete
17+
path: src/
18+
remote_path: ${{ secrets.REMOTE_PATH }}
19+
remote_host: ${{ secrets.REMOTE_HOST }}
20+
remote_port: ${{ secrets.REMOTE_PORT }}
21+
remote_user: ${{ secrets.REMOTE_USER }}
22+
remote_key: ${{ secrets.REMOTE_PRIVATE_KEY }}
23+
- name: Start Docker
24+
run: |
25+
ssh ${{ secrets.REMOTE_USER }}@${{ secrets.REMOTE_HOST }} "cd ${{ secrets.REMOTE_PATH }}; docker compose pull; docker compose up -d --build --force-recreate"

0 commit comments

Comments
 (0)