From ab37f1dd56cb61e5fb55039f303788499e870eec Mon Sep 17 00:00:00 2001 From: Naor Tedgi Date: Sat, 10 Apr 2021 09:51:47 +0300 Subject: [PATCH 1/7] adding deploy action --- .github/workflows/deploy.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .github/workflows/deploy.yaml diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..870ce87 --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,8 @@ +- name: executing remote ssh commands using ssh key + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + key: ${{ secrets.KEY }} + script: whoami + \ No newline at end of file From 94c07676d4fb06ddf16f96624bc3356ac73ca711 Mon Sep 17 00:00:00 2001 From: Naor Tedgi Date: Sat, 10 Apr 2021 09:54:19 +0300 Subject: [PATCH 2/7] int deploy script --- .github/workflows/deploy.yaml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 870ce87..0fb5e88 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -1,8 +1,15 @@ -- name: executing remote ssh commands using ssh key - uses: appleboy/ssh-action@master - with: - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - key: ${{ secrets.KEY }} - script: whoami - \ No newline at end of file +name: remote ssh command +on: [push] +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 }} + key: ${{ secrets.KEY }} + script: whoami \ No newline at end of file From 5932ae29d1a8e15dfa490069e4953c74058081f8 Mon Sep 17 00:00:00 2001 From: Naor Tedgi Date: Sat, 10 Apr 2021 09:56:50 +0300 Subject: [PATCH 3/7] u[date brach rule --- .github/workflows/deploy.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 0fb5e88..e627db9 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -9,7 +9,7 @@ jobs: - name: executing remote ssh commands using password uses: appleboy/ssh-action@master with: - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - key: ${{ secrets.KEY }} + host: ${{ secrets.DEPLOY_HOST }} + username: ${{ secrets.DEPLOY_USER }} + key: ${{ secrets.DEPLOY_KEY }} script: whoami \ No newline at end of file From 3c8d14401e2059928508e506950c66e98ab01869 Mon Sep 17 00:00:00 2001 From: Naor Tedgi Date: Sat, 10 Apr 2021 10:08:07 +0300 Subject: [PATCH 4/7] add deploy script test --- .github/workflows/deploy.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index e627db9..dcffeb3 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -12,4 +12,5 @@ jobs: host: ${{ secrets.DEPLOY_HOST }} username: ${{ secrets.DEPLOY_USER }} key: ${{ secrets.DEPLOY_KEY }} - script: whoami \ No newline at end of file + script: cd node-efficientnet && git pull && cd playground && docker-compose down && docker system prune -a && docker-compose up -d + \ No newline at end of file From d84a19f38543e701f4e915bd1e8eb6e8da1f212c Mon Sep 17 00:00:00 2001 From: Naor Tedgi Date: Sat, 10 Apr 2021 10:31:11 +0300 Subject: [PATCH 5/7] change delpoyment header --- .github/workflows/deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index dcffeb3..65621f1 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -1,4 +1,4 @@ -name: remote ssh command +name: Deploy Landing Page on: [push] jobs: From 8f5d6ab085cbd9ae8b9ddde4a9fb175607462daa Mon Sep 17 00:00:00 2001 From: Naor Tedgi Date: Sat, 10 Apr 2021 10:36:48 +0300 Subject: [PATCH 6/7] adding deployment script --- .github/workflows/deploy.yaml | 2 +- deploy.sh | 7 +++++++ package.json | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 deploy.sh diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 65621f1..63a52e7 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -12,5 +12,5 @@ jobs: host: ${{ secrets.DEPLOY_HOST }} username: ${{ secrets.DEPLOY_USER }} key: ${{ secrets.DEPLOY_KEY }} - script: cd node-efficientnet && git pull && cd playground && docker-compose down && docker system prune -a && docker-compose up -d + script: cd node-efficientnet && git pull && npm run deploy:playground \ No newline at end of file diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 0000000..0f70a38 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -e +set -x +cd playground +docker-compose down +docker system prune -a < y +docker-compose up -d diff --git a/package.json b/package.json index 0a886bc..03737c6 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,8 @@ "lint:md": "remark .", "test:unit":"jest --clearCache && jest --coverage", "test:prapare":"npm link && cd tester && npm link node-efficientnet", - "test:playground": "cd playground/server && npm i && npm test" + "test:playground": "cd playground/server && npm i && npm test", + "deploy:playground": "sh deploy.sh" }, "repository": { "type": "git", From 1b14f22f8fdf289cf3ecd1d3a6c3e05af87ff2e1 Mon Sep 17 00:00:00 2001 From: Naor Tedgi Date: Sat, 10 Apr 2021 10:38:15 +0300 Subject: [PATCH 7/7] remove coveralls --- .github/workflows/coverage.yml | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml deleted file mode 100644 index af99ffb..0000000 --- a/.github/workflows/coverage.yml +++ /dev/null @@ -1,26 +0,0 @@ -# This workflow will do a clean install of node dependencies, build the source code and run tests -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions - -name: Coveralls - -# trigger build when pushing, or when creating a pull request -on: [push, pull_request] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Use Node.js 14.x - uses: actions/setup-node@v1 - with: - node-version: 14.x - - run: npm install - - run: npm run build --if-present - - run: npm run test - - name: Coveralls - uses: coverallsapp/github-action@master - with: - github-token: ${{ secrets.COVER_TOKEN }}