-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (29 loc) · 853 Bytes
/
Copy pathci-cd.yml
File metadata and controls
34 lines (29 loc) · 853 Bytes
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: CI/CD Pipeline
on:
push:
branches:
- main
jobs:
test:
name: Testing branch
uses: ./.github/workflows/ci.yml
deploy_to_server:
name: Deploy Project
needs:
- test
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.VM_KEY }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
- name: Transfer files
run: |
rsync -rlpvi --delete --delete-during \
--exclude-from=rsync-exclude \
./ ${{ secrets.SSH_USER }}@${{ secrets.VM_IP }}:/volume/p7svr/
- name: Reboot services on server
run: ssh ${{ secrets.SSH_USER }}@${{ secrets.VM_IP }} ". /volume/p7svr/deployment/reload_services.sh"