From 02606c46eb9cd3fca0443cd91543c905cd5c807b Mon Sep 17 00:00:00 2001 From: holadmex Date: Sun, 21 Jul 2024 13:05:42 +0100 Subject: [PATCH 1/2] Added deployment workflow for production --- .github/workflows/prod.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/prod.yml b/.github/workflows/prod.yml index 87c8e0c2..d2fbdcb3 100644 --- a/.github/workflows/prod.yml +++ b/.github/workflows/prod.yml @@ -16,7 +16,7 @@ jobs: - name: Pull from github id: pull run: | - git pull origin prod + git pull origin dev - name: install dependencies run: yarn install From 38ccd6a88e0e097df3e297fe55ec68831f464e54 Mon Sep 17 00:00:00 2001 From: holadmex Date: Sun, 21 Jul 2024 19:37:51 +0100 Subject: [PATCH 2/2] changes added to deployment workflow for prod --- .github/workflows/prod.yml | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/.github/workflows/prod.yml b/.github/workflows/prod.yml index d2fbdcb3..dd4ef554 100644 --- a/.github/workflows/prod.yml +++ b/.github/workflows/prod.yml @@ -2,7 +2,7 @@ name: Build, Test, and Deploy for Prod Branch on: push: - branch: + branches: - main jobs: @@ -13,26 +13,22 @@ jobs: working-directory: /var/www/aihomework/prod steps: - - name: Pull from github - id: pull + - name: Pull from GitHub run: | - git pull origin dev + git fetch origin + git reset --hard origin/main - - name: install dependencies + - name: Install dependencies run: yarn install - - name: buld the dist + - name: Build the dist run: yarn build - - name: setup service file + - name: Setup service file run: sudo cp server-script/aihomeworkprod.service /etc/systemd/system - - name: start the app + - name: Start the app run: | sudo systemctl daemon-reload sudo systemctl restart aihomeworkprod - # test: - # -name: Run test - # run: yarn jest -