From 4f5f10988818de51a66df6814923a972249a7215 Mon Sep 17 00:00:00 2001 From: soheil khaledabadi Date: Sat, 22 Jun 2024 19:00:59 +0330 Subject: [PATCH 1/3] Create -> node.js.yml --- .github/workflows/node.js.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/node.js.yml diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 0000000..892448b --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,23 @@ +name: Persian Game Shop + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: executing remote ssh commands using password + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + password: ${{ secrets.PASSWORD }} + port: ${{ secrets.PORT }} + script: | + ls -lah + bash /var/www/html/persian-game/build.sh From 29d881ebca5348549235496ba806a488112d0dce Mon Sep 17 00:00:00 2001 From: soheil khaledabadi Date: Sat, 22 Jun 2024 19:03:36 +0330 Subject: [PATCH 2/3] Create -> bash file for build project on server --- build.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 build.sh diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..5dcbb83 --- /dev/null +++ b/build.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +REPO_DIR="/var/www/html/persian-ping/" + +TOKEN="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" + +cd $REPO_DIR + +echo $TOKEN | git pull https://$TOKEN@github.com/joshfe/persian-game.git + +npm i +npm run build +ls -al \ No newline at end of file From 3c29815c583fdc74aba85ae3d0c94706472ec935 Mon Sep 17 00:00:00 2001 From: soheil khaledabadi Date: Sat, 22 Jun 2024 19:05:37 +0330 Subject: [PATCH 3/3] Update -> change directory --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 5dcbb83..084873b 100644 --- a/build.sh +++ b/build.sh @@ -1,6 +1,6 @@ #!/bin/bash -REPO_DIR="/var/www/html/persian-ping/" +REPO_DIR="/var/www/html/persian-game/" TOKEN="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"