From 40f3dca307575bc1cebd661324ef2f618bde2738 Mon Sep 17 00:00:00 2001 From: Stephen Adeniji Date: Tue, 13 Aug 2024 22:03:21 +0100 Subject: [PATCH 01/12] fix: update admin sidebar links --- .../dashboard/(admin)/_components/layout/Sidebar/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/dashboard/(admin)/_components/layout/Sidebar/index.tsx b/src/app/dashboard/(admin)/_components/layout/Sidebar/index.tsx index 2c7b25daa..85e849c59 100644 --- a/src/app/dashboard/(admin)/_components/layout/Sidebar/index.tsx +++ b/src/app/dashboard/(admin)/_components/layout/Sidebar/index.tsx @@ -18,7 +18,7 @@ import { FC, ForwardRefExoticComponent, RefAttributes } from "react"; const sideItems = [ { route: "Dashboard", - link: "/dashboard/admin/dashboard", + link: "/dashboard/admin", icon: House, id: "dashboard", }, @@ -42,7 +42,7 @@ const sideItems = [ }, { route: "Squeeze Pages", - link: "/dashboard/admin/squeeze-pages", + link: "/dashboard/admin/faqs", icon: List, id: "squeeze", }, From 5601a8c7f8a5f25e1da2ba9233160ab7654b20ca Mon Sep 17 00:00:00 2001 From: Stephen Adeniji Date: Wed, 14 Aug 2024 17:08:29 +0100 Subject: [PATCH 02/12] Revert "fix: update admin sidebar links" This reverts commit 40f3dca307575bc1cebd661324ef2f618bde2738. --- .../dashboard/(admin)/_components/layout/Sidebar/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/dashboard/(admin)/_components/layout/Sidebar/index.tsx b/src/app/dashboard/(admin)/_components/layout/Sidebar/index.tsx index 85e849c59..2c7b25daa 100644 --- a/src/app/dashboard/(admin)/_components/layout/Sidebar/index.tsx +++ b/src/app/dashboard/(admin)/_components/layout/Sidebar/index.tsx @@ -18,7 +18,7 @@ import { FC, ForwardRefExoticComponent, RefAttributes } from "react"; const sideItems = [ { route: "Dashboard", - link: "/dashboard/admin", + link: "/dashboard/admin/dashboard", icon: House, id: "dashboard", }, @@ -42,7 +42,7 @@ const sideItems = [ }, { route: "Squeeze Pages", - link: "/dashboard/admin/faqs", + link: "/dashboard/admin/squeeze-pages", icon: List, id: "squeeze", }, From fcb752cc990d610b8234c09a628099c7c8cc3ab5 Mon Sep 17 00:00:00 2001 From: Stephen Adeniji Date: Wed, 14 Aug 2024 18:03:49 +0100 Subject: [PATCH 03/12] chore: add faqs menu item --- .../(admin)/_components/layout/Sidebar/index.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/app/dashboard/(admin)/_components/layout/Sidebar/index.tsx b/src/app/dashboard/(admin)/_components/layout/Sidebar/index.tsx index 2c7b25daa..df7769237 100644 --- a/src/app/dashboard/(admin)/_components/layout/Sidebar/index.tsx +++ b/src/app/dashboard/(admin)/_components/layout/Sidebar/index.tsx @@ -1,6 +1,7 @@ "use client"; import { + Bot, Box, House, List, @@ -18,7 +19,7 @@ import { FC, ForwardRefExoticComponent, RefAttributes } from "react"; const sideItems = [ { route: "Dashboard", - link: "/dashboard/admin/dashboard", + link: "/dashboard/admin", icon: House, id: "dashboard", }, @@ -52,6 +53,12 @@ const sideItems = [ icon: TabletSmartphone, id: "waitlist", }, + { + route: "FAQs", + link: "/dashboard/admin/faqs", + icon: Bot, + id: "faqs", + }, { route: "Settings", link: "/dashboard/admin/settings", From 60e9be8a217b5725135e293fc2d13023975ef3f0 Mon Sep 17 00:00:00 2001 From: Ravencodess <115118888+Ravencodess@users.noreply.github.com> Date: Thu, 15 Aug 2024 13:27:15 +0100 Subject: [PATCH 04/12] Update build-and-upload.yml Signed-off-by: Ravencodess <115118888+Ravencodess@users.noreply.github.com> --- .github/workflows/build-and-upload.yml | 68 +++++++++++++------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/.github/workflows/build-and-upload.yml b/.github/workflows/build-and-upload.yml index 86dc3ff7e..44e9d9e08 100644 --- a/.github/workflows/build-and-upload.yml +++ b/.github/workflows/build-and-upload.yml @@ -10,38 +10,38 @@ jobs: runs-on: ubuntu-latest if: github.event.repository.fork == false - environment: - name: "dev" - url: ${{ vars.URL }} - steps: - - uses: actions/checkout@v3 - - - name: Build Docker image - run: docker build -t hngdevops/nextjs-boilerplate:dev -f docker/development/Dockerfile . - - - name: Save and compress Docker image - run: | - docker save hngdevops/nextjs-boilerplate:dev > nextjs-dev.tar - gzip nextjs-dev.tar - - - name: Copy to server - uses: appleboy/scp-action@master - with: - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - password: ${{ secrets.PASSWORD }} - source: "nextjs-dev.tar.gz" - target: "/tmp/nextjs" - - - name: Load image in server - uses: appleboy/ssh-action@v1.0.3 - with: - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - password: ${{ secrets.PASSWORD }} - script: | - cd /tmp/nextjs - gunzip nextjs-dev.tar.gz - docker load < nextjs-dev.tar - rm -f nextjs-dev.tar + - uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: "20" + + - name: Cache pnpm modules + uses: actions/cache@v3 + with: + path: ~/.pnpm-store + key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm- + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: Install dependencies + run: pnpm install + + - name: Build Next.js application + run: pnpm build + + - name: Archive production artifacts + run: tar -czf aivideo-dev.tar.gz .next public + + - name: Upload coverage reports + uses: actions/upload-artifact@v3 + with: + name: boilerplate-build + path: aivideo-dev.tar.gz From 094d2f29f9d04686689a94a26135f409a56d454f Mon Sep 17 00:00:00 2001 From: Ravencodess <115118888+Ravencodess@users.noreply.github.com> Date: Thu, 15 Aug 2024 13:41:39 +0100 Subject: [PATCH 05/12] Update build-and-upload.yml Signed-off-by: Ravencodess <115118888+Ravencodess@users.noreply.github.com> --- .github/workflows/build-and-upload.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-upload.yml b/.github/workflows/build-and-upload.yml index 44e9d9e08..2daf93104 100644 --- a/.github/workflows/build-and-upload.yml +++ b/.github/workflows/build-and-upload.yml @@ -38,10 +38,10 @@ jobs: run: pnpm build - name: Archive production artifacts - run: tar -czf aivideo-dev.tar.gz .next public + run: tar -czf boilerplate.tar.gz .next public - - name: Upload coverage reports + - name: Upload production artifacts uses: actions/upload-artifact@v3 with: name: boilerplate-build - path: aivideo-dev.tar.gz + path: boilerplate.tar.gz From dfe2bdf9dce12c2e44c48443ac6d7c866cbd86c4 Mon Sep 17 00:00:00 2001 From: Ravencodess <115118888+Ravencodess@users.noreply.github.com> Date: Thu, 15 Aug 2024 13:54:48 +0100 Subject: [PATCH 06/12] Create anchor-deploy.yaml Signed-off-by: Ravencodess <115118888+Ravencodess@users.noreply.github.com> --- .github/workflows/anchor-deploy.yaml | 49 ++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/anchor-deploy.yaml diff --git a/.github/workflows/anchor-deploy.yaml b/.github/workflows/anchor-deploy.yaml new file mode 100644 index 000000000..485732f78 --- /dev/null +++ b/.github/workflows/anchor-deploy.yaml @@ -0,0 +1,49 @@ +name: Anchor Deployment + +on: + workflow_run: + workflows: ["Build and Upload"] + types: + - completed + +jobs: + deploy_to_dev: + if: ${{ github.event.workflow_run.conclusion == 'success' }} + runs-on: ubuntu-latest + + environment: + name: "anchor-java" + url: ${{ vars.URL }} + + steps: + - name: Download build artifact + uses: actions/download-artifact@v4 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + run-id: ${{ github.event.workflow_run.id }} + name: boilerplate-build + path: boilerplate.tar.gz + + - name: Decode and create .env file + run: | + echo ${{ secrets.ENV }} | base64 -d > .env.java + + - name: Copy Artifacts to server + run: | + sudo apt update && sudo apt install sshpass -y + sshpass -p ${{ secrets.PASSWORD }} scp -o StrictHostKeyChecking=no boilerplate.tar.gz .env.java ${{ secrets.USERNAME }}@${{ secrets.HOST }}:/tmp/ + rm -f boilerplate.tar.gz .env + + - name: Deploy on server + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + password: ${{ secrets.PASSWORD }} + script: | + cd boilerplate + rm -rf * + tar -xzf /tmp/boilerplate.tar.gz + mv /tmp/.env.java .env + rm -f /tmp/boilerplate.tar.gz + cp -r .next/standalone/* . From b838b70c6f63d4d85dbd811a9232020c3f3ec70f Mon Sep 17 00:00:00 2001 From: Ravencodess <115118888+Ravencodess@users.noreply.github.com> Date: Thu, 15 Aug 2024 14:06:30 +0100 Subject: [PATCH 07/12] Update anchor-deploy.yaml Signed-off-by: Ravencodess <115118888+Ravencodess@users.noreply.github.com> --- .github/workflows/anchor-deploy.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/anchor-deploy.yaml b/.github/workflows/anchor-deploy.yaml index 485732f78..706728db2 100644 --- a/.github/workflows/anchor-deploy.yaml +++ b/.github/workflows/anchor-deploy.yaml @@ -28,11 +28,14 @@ jobs: run: | echo ${{ secrets.ENV }} | base64 -d > .env.java + - name: Check directory contents + run: ls -la + - name: Copy Artifacts to server run: | sudo apt update && sudo apt install sshpass -y - sshpass -p ${{ secrets.PASSWORD }} scp -o StrictHostKeyChecking=no boilerplate.tar.gz .env.java ${{ secrets.USERNAME }}@${{ secrets.HOST }}:/tmp/ - rm -f boilerplate.tar.gz .env + sshpass -p ${{ secrets.PASSWORD }} scp -o StrictHostKeyChecking=no ./boilerplate.tar.gz .env.java ${{ secrets.USERNAME }}@${{ secrets.HOST }}:/tmp/ + rm -f ./boilerplate.tar.gz .env - name: Deploy on server uses: appleboy/ssh-action@master From 04fa531b13dca1a4c286f8bff813c039fe03f324 Mon Sep 17 00:00:00 2001 From: Ravencodess <115118888+Ravencodess@users.noreply.github.com> Date: Thu, 15 Aug 2024 14:08:20 +0100 Subject: [PATCH 08/12] Update build-and-upload.yml Signed-off-by: Ravencodess <115118888+Ravencodess@users.noreply.github.com> --- .github/workflows/build-and-upload.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-and-upload.yml b/.github/workflows/build-and-upload.yml index 2daf93104..12def1ed4 100644 --- a/.github/workflows/build-and-upload.yml +++ b/.github/workflows/build-and-upload.yml @@ -45,3 +45,6 @@ jobs: with: name: boilerplate-build path: boilerplate.tar.gz + + - name: Delete zip file + run: rm -f boilerplate.tar.gz From 89dd3604e0e105b6a39fe6eba34df84e2209854d Mon Sep 17 00:00:00 2001 From: Ravencodess <115118888+Ravencodess@users.noreply.github.com> Date: Thu, 15 Aug 2024 14:16:47 +0100 Subject: [PATCH 09/12] Update anchor-deploy.yaml Signed-off-by: Ravencodess <115118888+Ravencodess@users.noreply.github.com> --- .github/workflows/anchor-deploy.yaml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/anchor-deploy.yaml b/.github/workflows/anchor-deploy.yaml index 706728db2..490435f49 100644 --- a/.github/workflows/anchor-deploy.yaml +++ b/.github/workflows/anchor-deploy.yaml @@ -22,20 +22,17 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} run-id: ${{ github.event.workflow_run.id }} name: boilerplate-build - path: boilerplate.tar.gz + path: . - name: Decode and create .env file run: | echo ${{ secrets.ENV }} | base64 -d > .env.java - - name: Check directory contents - run: ls -la - - name: Copy Artifacts to server run: | sudo apt update && sudo apt install sshpass -y - sshpass -p ${{ secrets.PASSWORD }} scp -o StrictHostKeyChecking=no ./boilerplate.tar.gz .env.java ${{ secrets.USERNAME }}@${{ secrets.HOST }}:/tmp/ - rm -f ./boilerplate.tar.gz .env + sshpass -p ${{ secrets.PASSWORD }} scp -o StrictHostKeyChecking=no boilerplate.tar.gz .env.java ${{ secrets.USERNAME }}@${{ secrets.HOST }}:/tmp/ + rm -f boilerplate.tar.gz .env - name: Deploy on server uses: appleboy/ssh-action@master From bc315ba856ffc543cd2565f37446c2167e99bbd2 Mon Sep 17 00:00:00 2001 From: Ravencodess <115118888+Ravencodess@users.noreply.github.com> Date: Thu, 15 Aug 2024 15:27:04 +0100 Subject: [PATCH 10/12] Update anchor-deploy.yaml Signed-off-by: Ravencodess <115118888+Ravencodess@users.noreply.github.com> --- .github/workflows/anchor-deploy.yaml | 58 ++++++++++++++++++++++++---- 1 file changed, 51 insertions(+), 7 deletions(-) diff --git a/.github/workflows/anchor-deploy.yaml b/.github/workflows/anchor-deploy.yaml index 490435f49..40ef30d1f 100644 --- a/.github/workflows/anchor-deploy.yaml +++ b/.github/workflows/anchor-deploy.yaml @@ -7,7 +7,7 @@ on: - completed jobs: - deploy_to_dev: + deploy_to_java: if: ${{ github.event.workflow_run.conclusion == 'success' }} runs-on: ubuntu-latest @@ -31,8 +31,8 @@ jobs: - name: Copy Artifacts to server run: | sudo apt update && sudo apt install sshpass -y - sshpass -p ${{ secrets.PASSWORD }} scp -o StrictHostKeyChecking=no boilerplate.tar.gz .env.java ${{ secrets.USERNAME }}@${{ secrets.HOST }}:/tmp/ - rm -f boilerplate.tar.gz .env + sshpass -p ${{ secrets.PASSWORD }} scp -o StrictHostKeyChecking=no boilerplate.tar.gz .env.java ${{ secrets.USERNAME }}@${{ secrets.HOST }}:/tmp/java + rm -f boilerplate.tar.gz .env.java - name: Deploy on server uses: appleboy/ssh-action@master @@ -41,9 +41,53 @@ jobs: username: ${{ secrets.USERNAME }} password: ${{ secrets.PASSWORD }} script: | - cd boilerplate + cd boilerplate-frontend rm -rf * - tar -xzf /tmp/boilerplate.tar.gz - mv /tmp/.env.java .env - rm -f /tmp/boilerplate.tar.gz + tar -xzf /tmp/java/boilerplate.tar.gz + mv /tmp/java/.env.java .env + rm -f /tmp/java/boilerplate.tar.gz cp -r .next/standalone/* . + pm2 restart java-boilerplate --update-env + + + deploy_to_python: + if: ${{ github.event.workflow_run.conclusion == 'success' }} + runs-on: ubuntu-latest + + environment: + name: "anchor-python" + url: ${{ vars.URL }} + + steps: + - name: Download build artifact + uses: actions/download-artifact@v4 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + run-id: ${{ github.event.workflow_run.id }} + name: boilerplate-build + path: . + + - name: Decode and create .env file + run: | + echo ${{ secrets.ENV }} | base64 -d > .env.python + + - name: Copy Artifacts to server + run: | + sudo apt update && sudo apt install sshpass -y + sshpass -p ${{ secrets.PASSWORD }} scp -o StrictHostKeyChecking=no boilerplate.tar.gz .env.python ${{ secrets.USERNAME }}@${{ secrets.HOST }}:/tmp/python + rm -f boilerplate.tar.gz .env.python + + - name: Deploy on server + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + password: ${{ secrets.PASSWORD }} + script: | + cd boilerplate-frontend + rm -rf * + tar -xzf /tmp/python/boilerplate.tar.gz + mv /tmp/python/.env.java .env + rm -f /tmp/python/boilerplate.tar.gz + cp -r .next/standalone/* . + pm2 restart python-boilerplate --update-env From f8df6d948e2bad8800e185f9123d5aae557a6e52 Mon Sep 17 00:00:00 2001 From: Tella Boluwatife <42048129+codeReaper0@users.noreply.github.com> Date: Thu, 15 Aug 2024 16:38:52 +0100 Subject: [PATCH 11/12] Create starlight-deploy.yml Signed-off-by: Tella Boluwatife <42048129+codeReaper0@users.noreply.github.com> --- .github/workflows/starlight-deploy.yml | 50 ++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/starlight-deploy.yml diff --git a/.github/workflows/starlight-deploy.yml b/.github/workflows/starlight-deploy.yml new file mode 100644 index 000000000..a528677b9 --- /dev/null +++ b/.github/workflows/starlight-deploy.yml @@ -0,0 +1,50 @@ +name: Starlight Deployment + +on: + workflow_run: + workflows: ["Build and Upload"] + types: + - completed + +jobs: + deploy_to_nestsjs: + if: ${{ github.event.workflow_run.conclusion == 'success' }} + runs-on: ubuntu-latest + + environment: + name: "starlight-nestjs" + url: ${{ vars.URL }} + + steps: + - name: Download build artifact + uses: actions/download-artifact@v4 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + run-id: ${{ github.event.workflow_run.id }} + name: boilerplate-build + path: . + + - name: Decode and create .env file + run: | + echo ${{ secrets.ENV }} | base64 -d > .env.nestsjs + + - name: Copy Artifacts to server + run: | + sudo apt update && sudo apt install sshpass -y + sshpass -p ${{ secrets.PASSWORD }} scp -o StrictHostKeyChecking=no boilerplate.tar.gz .env.nestsjs ${{ secrets.USERNAME }}@${{ secrets.HOST }}:/tmp/nestsjs + rm -f boilerplate.tar.gz .env.nestsjs + + - name: Deploy on server + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + password: ${{ secrets.PASSWORD }} + script: | + cd /home/bingofe/boilerplate + rm -rf * + tar -xzf /tmp/nestsjs/boilerplate.tar.gz + mv /tmp/nestsjs/.env.nestsjs .env + rm -f /tmp/nestsjs/boilerplate.tar.gz + cp -r .next/standalone/* . + pm2 restart nestsjs-boilerplate --update-env From 97eb2cf9b5b4fc3eaef5b754deeb7f69fa1c4cdb Mon Sep 17 00:00:00 2001 From: Ravencodess <115118888+Ravencodess@users.noreply.github.com> Date: Thu, 15 Aug 2024 17:23:34 +0100 Subject: [PATCH 12/12] Update anchor-deploy.yaml Signed-off-by: Ravencodess <115118888+Ravencodess@users.noreply.github.com> --- .github/workflows/anchor-deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/anchor-deploy.yaml b/.github/workflows/anchor-deploy.yaml index 40ef30d1f..c6e2e6e8a 100644 --- a/.github/workflows/anchor-deploy.yaml +++ b/.github/workflows/anchor-deploy.yaml @@ -87,7 +87,7 @@ jobs: cd boilerplate-frontend rm -rf * tar -xzf /tmp/python/boilerplate.tar.gz - mv /tmp/python/.env.java .env + mv /tmp/python/.env.python .env rm -f /tmp/python/boilerplate.tar.gz cp -r .next/standalone/* . pm2 restart python-boilerplate --update-env