-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (29 loc) · 903 Bytes
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: Deploy Project
on:
push:
tags:
- "v*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Rsync to prod server
uses: burnett01/rsync-deployments@6.0.0
with:
switches: -avzr --delete
path: ./
remote_path: /home/git/${{ github.repository }}/${{ github.ref }}
remote_host: ${{ secrets.PROD_SERVER_HOST }}
remote_user: git
remote_key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: SSH into development server and run Docker Compose
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.PROD_SERVER_HOST }}
username: git
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd /home/git/${{ github.repository }}/${{ github.ref }}
docker-compose up -d