Skip to content

Commit f082f6f

Browse files
committed
Merge branch 'develop' of https://github.com/atlp-rwanda/atlp-devpulse-fn into fix-ticket-loading
2 parents f185db1 + a36b93f commit f082f6f

File tree

137 files changed

+4802
-803
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+4802
-803
lines changed

.babelrc

100755100644
File mode changed.

.circleci/config.yml

100755100644
File mode changed.

.github/workflows/docker-img.yml

Lines changed: 46 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,71 @@
11
name: Login to Digital Ocean and create a directory
22

33
on:
4-
pull_request:
4+
push:
55
branches:
66
- develop
77

88
jobs:
99
build-and-push:
1010
runs-on: ubuntu-latest
11+
env:
12+
BACKEND_URL: ${{ secrets.BACKEND_URL }}
13+
CLIENT_ID: ${{ secrets.CLIENT_ID }}
14+
PUSHER_KEY: ${{ secrets.PUSHER_KEY }}
15+
PUSHER_CLUSTER: ${{ secrets.PUSHER_CLUSTER }}
16+
REACT_APP_CLOUDINARY_UPLOAD_PRESET: ${{ secrets.REACT_APP_CLOUDINARY_UPLOAD_PRESET }}
17+
REACT_APP_CLOUDINARY_NAME: ${{ secrets.REACT_APP_CLOUDINARY_NAME }}
1118
steps:
12-
- name: Login to docker
19+
- name: Checkout code
20+
uses: actions/checkout@v3
21+
22+
- name: Login to Docker Hub
1323
uses: docker/login-action@v2
1424
with:
1525
username: ${{ secrets.DOCKER_HUB_USERNAME }}
1626
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
17-
- name: Build and Push docker image
27+
28+
- name: Build and Push Docker Image
1829
uses: docker/build-push-action@v4
1930
with:
2031
push: true
2132
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/atlp-devpulse-fn:latest
22-
- name: Login to DO
33+
34+
- name: Login to Digital Ocean Server
2335
uses: appleboy/ssh-action@master
2436
with:
2537
host: ${{ secrets.DO_HOST }}
2638
username: ${{ secrets.DO_USERNAME }}
2739
key: ${{ secrets.DO_KEY }}
2840
port: ${{ secrets.DO_PORT }}
41+
envs: BACKEND_URL, PUSHER_KEY, PUSHER_CLUSTER, REACT_APP_CLOUDINARY_UPLOAD_PRESET, REACT_APP_CLOUDINARY_NAME, CLIENT_ID, JWT_SECRET
2942
script: |
30-
docker pull devpulse/atlp-devpulse-fn:latest
31-
docker ps | grep 4010 | cut -f1 -d' ' | xargs docker stop
32-
docker run -p 4010:81 -d --add-host=devpulse-backend:161.35.150.208 devpulse/atlp-devpulse-fn:latest
43+
44+
# Create .env file with required environment variables
45+
cat <<EOF > .env
46+
BACKEND_URL=${{ secrets.BACKEND_URL }}
47+
CLIENT_ID=${{ secrets.CLIENT_ID }}
48+
PUSHER_KEY=${{ secrets.PUSHER_KEY }}
49+
PUSHER_CLUSTER=${{ secrets.PUSHER_CLUSTER }}
50+
REACT_APP_CLOUDINARY_UPLOAD_PRESET=${{ secrets.REACT_APP_CLOUDINARY_UPLOAD_PRESET }}
51+
REACT_APP_CLOUDINARY_NAME=${{ secrets.REACT_APP_CLOUDINARY_NAME }}
52+
JWT_SECRET=${{ secrets.JWT_SECRET }}
53+
EOF
54+
55+
# Pull the latest Docker image
56+
docker pull ${{ secrets.DOCKER_HUB_USERNAME }}/atlp-devpulse-fn:latest
57+
58+
# Stop and remove any existing container on port 4010
59+
existing_container=$(docker ps -q --filter "publish=4010")
60+
if [ -n "$existing_container" ]; then
61+
docker stop "$existing_container"
62+
docker rm "$existing_container"
63+
fi
64+
65+
# Run the new container
66+
container_id=$(docker run -d \
67+
-p 4010:81 \
68+
--env-file .env \
69+
${{ secrets.DOCKER_HUB_USERNAME }}/atlp-devpulse-fn:latest)
70+
71+
echo "Container ID: $container_id"

.gitignore

100755100644
File mode changed.

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM node:22-alpine AS builder
33
WORKDIR /app
44

55
# Add the backend application in environment variables
6-
ENV BACKEND_URL=https://atlp-devpulse-bn.onrender.com
6+
ENV BACKEND_URL=https://applications-bn.devpulse.org
77

88
# Copy package.json and package-lock.json
99
COPY package*.json ./

README.md

100755100644
File mode changed.

__mocks__/fileMock.ts

100755100644
File mode changed.

__mocks__/styleMock.ts

100755100644
File mode changed.

index.html

100755100644
File mode changed.

jest.config.js

100755100644
File mode changed.

0 commit comments

Comments
 (0)