-
Notifications
You must be signed in to change notification settings - Fork 22
54 lines (48 loc) · 1.65 KB
/
forms.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Deploy configuration folder to server
on:
push:
branches:
- ampath-forms-configs
jobs:
deploy:
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- name: Checkout code
uses: actions/checkout@v2
id: checkout
with:
ref: ampath-forms-configs
- name: Copy folder to server
id: copy-folder
uses: appleboy/scp-action@master
with:
host: ${{ secrets.CICD_HOST }}
username: ${{ secrets.CICD_USERNAME }}
port: ${{ secrets.PORT }}
key: ${{ secrets.CICD_SECRET }}
source: "configuration/ampathforms"
target: "/apps/githubworkflows/OpenMrs3.0_assets"
- name: Move and Remove Old Configuration
id: ssh
uses: appleboy/[email protected]
with:
host: ${{ secrets.CICD_HOST }}
username: ${{ secrets.CICD_USERNAME }}
port: ${{ secrets.PORT }}
key: ${{ secrets.CICD_SECRET }}
script: |
sudo mv /var/lib/OpenMRS/configuration/ampathforms /apps/githubworkflows/OpenMrs3.0_assets/configuration/old_ampath
sudo mv /apps/githubworkflows/OpenMrs3.0_assets/configuration/ampathforms /var/lib/OpenMRS/configuration/
sudo rm -rf /apps/githubworkflows/OpenMrs3.0_assets/configuration/old_ampath
sudo rm -rf /var/lib/OpenMRS/configuration_checksums/ampathforms
- name: Restart Server
id: restart
uses: appleboy/[email protected]
with:
host: ${{ secrets.CICD_HOST }}
username: ${{ secrets.CICD_USERNAME }}
port: ${{ secrets.PORT }}
key: ${{ secrets.CICD_SECRET }}
script: sudo service tomcat9 restart