-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (40 loc) · 1.16 KB
/
deployd.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
name: Build Deploy and Run Docker
on:
workflow_run:
workflows: [ "SonarCloud" ]
types: [ requested ]
branches:
- master
jobs:
deployd:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Clone repository
run: |
git clone https://${{ secrets.USER_GI}}:${{ secrets.TOKEN_GI }}@${{secrets.REPOSITORY}}
env:
GH_TOKEN: ${{ secrets.TOKEN_GI }}
- name: Install OpenVPN
run: sudo apt-get install openvpn
- name: Move the dir to configuration openvpn
run: |
sudo mv ./certs/ ${{secrets.PATH_DIR_OVPN}}
- name: cd to certs and run openvpn
run: |
cd ${{secrets.PATH_DIR_OVPN}}/certs
sudo openvpn --config ${{ secrets.CERT}} &
- name: Esperar 15 segundos
run: sleep 15
- name: SSH Deployment
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd ${{ secrets.WORK_DIR}}
git pull
docker compose down
docker compose up -d --build