From 6e3d1e0b3aa6359be8aef1f5663ae5bf6a75dfcc Mon Sep 17 00:00:00 2001 From: Ravencodess <115118888+Ravencodess@users.noreply.github.com> Date: Tue, 29 Oct 2024 15:01:32 +0100 Subject: [PATCH 1/3] Update staging-deployment.yml Signed-off-by: Ravencodess <115118888+Ravencodess@users.noreply.github.com> --- .github/workflows/staging-deployment.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/staging-deployment.yml b/.github/workflows/staging-deployment.yml index 1f1ab0dfe..4c8c31a15 100644 --- a/.github/workflows/staging-deployment.yml +++ b/.github/workflows/staging-deployment.yml @@ -66,5 +66,8 @@ jobs: cd ~/hng_boilerplate_nextjs/staging tar -xzf nextjs-staging.tar.gz rm -f nextjs-staging.tar.gz - cp -r .next/standalone/* . + git stash + git reset --hard + git pull + pnpm install pm2 restart boilerplate_fe_staging --update-env From e031e69f68d91aadd5c4beb7b6313ed58635d501 Mon Sep 17 00:00:00 2001 From: Ravencodess <115118888+Ravencodess@users.noreply.github.com> Date: Tue, 29 Oct 2024 15:06:04 +0100 Subject: [PATCH 2/3] Update staging-deployment.yml Signed-off-by: Ravencodess <115118888+Ravencodess@users.noreply.github.com> --- .github/workflows/staging-deployment.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/staging-deployment.yml b/.github/workflows/staging-deployment.yml index 4c8c31a15..83035c7bc 100644 --- a/.github/workflows/staging-deployment.yml +++ b/.github/workflows/staging-deployment.yml @@ -42,7 +42,7 @@ jobs: run: pnpm build - name: Archive production artifacts - run: tar -czf nextjs-staging.tar.gz .next public .env + run: tar -czf nextjs-staging.tar.gz .next .env - name: Copy to server uses: appleboy/scp-action@master @@ -64,10 +64,11 @@ jobs: password: ${{ secrets.PASSWORD }} script: | cd ~/hng_boilerplate_nextjs/staging - tar -xzf nextjs-staging.tar.gz - rm -f nextjs-staging.tar.gz + git add . git stash git reset --hard git pull + tar -xzf nextjs-staging.tar.gz + rm -f nextjs-staging.tar.gz pnpm install pm2 restart boilerplate_fe_staging --update-env From df04aa228b426a63bb60d8645dd6ac21de121be2 Mon Sep 17 00:00:00 2001 From: Ravencodess <115118888+Ravencodess@users.noreply.github.com> Date: Tue, 29 Oct 2024 15:06:49 +0100 Subject: [PATCH 3/3] Update production-deployment.yml Signed-off-by: Ravencodess <115118888+Ravencodess@users.noreply.github.com> --- .github/workflows/production-deployment.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/production-deployment.yml b/.github/workflows/production-deployment.yml index fc838a57f..b8a4ed0a1 100644 --- a/.github/workflows/production-deployment.yml +++ b/.github/workflows/production-deployment.yml @@ -42,7 +42,7 @@ jobs: run: pnpm build - name: Archive production artifacts - run: tar -czf nextjs-prod.tar.gz .next public .env + run: tar -czf nextjs-prod.tar.gz .next .env - name: Copy to server uses: appleboy/scp-action@master @@ -64,6 +64,11 @@ jobs: password: ${{ secrets.PASSWORD }} script: | cd ~/hng_boilerplate_nextjs/prod - tar -xzf nextjs-prod.tar.gz - rm -f nextjs-prod.tar.gz + git add . + git stash + git reset --hard + git pull + tar -xzf nextjs-staging.tar.gz + rm -f nextjs-staging.tar.gz + pnpm install pm2 restart boilerplate_fe_prod --update-env