-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
Merge branch 'master' of https://github.com/palladiumkenya/kenyaemr_v…
Showing
4 changed files
with
198 additions
and
11,197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: deploying to test instance | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
|
||
jobs: | ||
deploy: | ||
name: Performing remote connection | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Remote Connection Setup | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.CICD2_HOST }} | ||
username: ${{ secrets.CICD2_USERNAME }} | ||
key: ${{ secrets.CICD2_SECRET }} | ||
port: ${{ secrets.PORT }} | ||
script: | | ||
# Set up deployment directory | ||
deploy_dir="/apps/github-workflows/mhealth-apps/kenyaemr_visualization_reciever" | ||
sudo rm -rf "$deploy_dir" | ||
sudo mkdir "$deploy_dir" | ||
sudo chown -R cicd2:cicd2 "$deploy_dir" | ||
# Clone repository | ||
git config --global --add safe.directory "$deploy_dir" | ||
git clone -b master https://github.com/palladiumkenya/kenyaemr_visualization_receiver.git "$deploy_dir" | ||
# Copy configuration files | ||
cp /apps/configs/kvisual/.env "$deploy_dir/" | ||
# Build and run Docker container | ||
docker stop kvisual | ||
docker rm -f kvisual | ||
docker build --no-cache -t kvisual:latest "$deploy_dir" | ||
docker run -p 7008:5000 --name kvisual -d --restart always --security-opt=no-new-privileges --log-opt max-size=10m \ | ||
--log-opt max-file=3 kvisual:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,15 @@ | ||
FROM node:12 | ||
FROM node:20.11.1-bullseye-slim | ||
|
||
WORKDIR /app | ||
COPY package.json /app | ||
RUN npm install | ||
COPY . /app | ||
CMD ["npm", "start"] | ||
|
||
COPY package*.json ./ | ||
|
||
RUN npm install && npm cache clean --force | ||
|
||
COPY . . | ||
|
||
EXPOSE 5000 | ||
|
||
ENV NODE_ENV=production | ||
|
||
CMD ["node", "index.js"] |
Oops, something went wrong.