From e5634f7f67a957845aa87bf2828d13fd68ddbdd3 Mon Sep 17 00:00:00 2001 From: Ishaan Mittal Date: Thu, 8 Aug 2024 01:55:29 +0530 Subject: [PATCH 1/4] update dockerfile (#145) --- Dockerfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0e2d9950..757503c3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,8 +2,6 @@ FROM node:alpine WORKDIR /usr/app -RUN npm install --global pm2 - COPY ./package.json ./ COPY ./yarn.lock ./ @@ -11,8 +9,8 @@ RUN yarn install --frozen-lockfile COPY ./ ./ -RUN npm run build +RUN yarn build USER node -CMD [ "pm2-runtime", "npm", "--", "start" ] \ No newline at end of file +CMD [ "yarn", "start" ] \ No newline at end of file From 078112eb72ed2e7371e4b00e43556d151c85d4a2 Mon Sep 17 00:00:00 2001 From: Ishaan Mittal Date: Thu, 8 Aug 2024 02:08:32 +0530 Subject: [PATCH 2/4] push to server workflow (#146) --- .github/workflows/push-to-server.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/push-to-server.yml diff --git a/.github/workflows/push-to-server.yml b/.github/workflows/push-to-server.yml new file mode 100644 index 00000000..f1093763 --- /dev/null +++ b/.github/workflows/push-to-server.yml @@ -0,0 +1,25 @@ +name: Push To Server + +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + name: deploy on remote + steps: + - uses: appleboy/ssh-action@v1.0.3 + with: + host: ${{ secrets.DC_HOST }} + username: ${{ secrets.DC_USER }} + password: ${{ secrets.DC_PASS }} + script: | + cd ~/tpc_portal/tpc-frontend + git pull origin main + docker stop tpc_portal-frontend-1 + docker rm tpc_portal-frontend-1 + docker rmi tpc_portal_frontend || true + cd .. + docker compose up -d \ No newline at end of file From ff7c2f9d5ac6faba91cbff9cd6aab961f387b8b4 Mon Sep 17 00:00:00 2001 From: Web Team <95338452+web-team-iiti@users.noreply.github.com> Date: Thu, 8 Aug 2024 02:11:38 +0530 Subject: [PATCH 3/4] Update push-to-server.yml --- .github/workflows/push-to-server.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push-to-server.yml b/.github/workflows/push-to-server.yml index f1093763..48e9e6e8 100644 --- a/.github/workflows/push-to-server.yml +++ b/.github/workflows/push-to-server.yml @@ -20,6 +20,6 @@ jobs: git pull origin main docker stop tpc_portal-frontend-1 docker rm tpc_portal-frontend-1 - docker rmi tpc_portal_frontend || true + docker rmi tpc_portal_frontend cd .. - docker compose up -d \ No newline at end of file + docker compose up -d From 37804634a8b1eb31b3eaad67572194cef3e9e702 Mon Sep 17 00:00:00 2001 From: Web Team <95338452+web-team-iiti@users.noreply.github.com> Date: Thu, 8 Aug 2024 02:13:51 +0530 Subject: [PATCH 4/4] Update push-to-server.yml --- .github/workflows/push-to-server.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-to-server.yml b/.github/workflows/push-to-server.yml index 48e9e6e8..681e1a84 100644 --- a/.github/workflows/push-to-server.yml +++ b/.github/workflows/push-to-server.yml @@ -20,6 +20,6 @@ jobs: git pull origin main docker stop tpc_portal-frontend-1 docker rm tpc_portal-frontend-1 - docker rmi tpc_portal_frontend + docker rmi tpc_portal-frontend || true cd .. docker compose up -d