-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (35 loc) · 1.61 KB
/
cicd_process.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
name: deploy to production
on:
push:
branches: [ master, dev ]
jobs:
build:
name: Deploying to Prod
runs-on: ubuntu-latest
steps:
- name: executing remote connection
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.CICD_SECRET }}
port: ${{ secrets.PORT }}
script: |
cd /apps/github-workflows/
sudo rm -rf dwh-his-frontend
sudo mkdir dwh-his-frontend
sudo chown -R cicd2:cicd2 dwh-his-frontend
git config --global --add safe.directory /apps/github-workflows/dwh-his-frontend
git clone https://github.com/palladiumkenya/dwh-his-frontend.git
cd /apps/github-workflows/dwh-his-frontend
git status
sudo cp /apps/dockerApps/dwh-his-frontend/Dockerfile /apps/github-workflows/dwh-his-frontend
sudo cp /apps/dockerApps/dwh-his-frontend/default.conf /apps/github-workflows/dwh-his-frontend
sudo cp /apps/dockerApps/dwh-his-frontend/nginx.conf /apps/github-workflows/dwh-his-frontend
sudo cp /apps/dockerApps/dwh-his-frontend/.env /apps/github-workflows/dwh-his-frontend
sudo cp -r /apps/dockerApps/dwh-his-frontend/ssl/ /apps/github-workflows/dwh-his-frontend
sudo chown -R cicd2:cicd2 /apps/github-workflows/dwh-his-frontend
sudo docker stop dwh-his-frontend
sudo docker rm dwh-his-frontend
sudo docker build -t dwh-his-frontend .
sudo docker run -d --name=dwh-his-frontend --restart always -p 3001:443 dwh-his-frontend:latest