Skip to content

Merge pull request #751 from palladiumkenya/feat/new-reporting-layer #100

Merge pull request #751 from palladiumkenya/feat/new-reporting-layer

Merge pull request #751 from palladiumkenya/feat/new-reporting-layer #100

Workflow file for this run

name: deploy to production
on:
push:
branches: [ production ]
jobs:
build:
name: Deploy
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-portal-backend
sudo mkdir dwh-portal-backend
sudo chown -R cicd2:cicd2 /apps/github-workflows/dwh-portal-backend
git config --global --add safe.directory /apps/github-workflows/dwh-portal-backend
cd /apps/github-workflows/dwh-portal-backend
git clone -b production https://github.com/palladiumkenya/dwh-portal-backend.git .
git status
sudo cp /apps/dockerApps/dwh-portal-backend/.env.production /apps/github-workflows/dwh-portal-backend
sudo cp /apps/dockerApps/dwh-portal-backend/Dockerfile /apps/github-workflows/dwh-portal-backend
sudo cp -r /apps/dockerApps/dwh-portal-backend/secrets /apps/github-workflows/dwh-portal-backend
sudo chown -R cicd2:cicd2 /apps/github-workflows/dwh-portal-backend
docker build -t cicdapplication/dwhportalbackend:latest .
docker stop dwhportalbackend
docker rm dwhportalbackend
docker run -p 8082:7000 -d --name=dwhportalbackend --restart always cicdapplication/dwhportalbackend:latest