From 27242aec7475785e49c3fb16b411b2ff7eb27504 Mon Sep 17 00:00:00 2001 From: lulu12329 Date: Sun, 25 Feb 2024 20:38:44 +0100 Subject: [PATCH 01/15] ops: add deploy pipelineFile --- .github/workflows/deploy.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..910d8c6 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,35 @@ +name: Deploy + +on: + push: + branches: ['deploy-pipeline'] + # tags: + # - 'v[0-9]+.[0-9]+.[0-9]+' + +jobs: + deploy: + runs-on: ubuntu-latest + # permissions: + # packages: write + # contents: read + + steps: + - name: executing remote ssh commands using password + uses: appleboy/ssh-action@v1.0.3 + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + password: ${{ secrets.PASSWORD }} + port: ${{ secrets.PORT }} + script: | + whoami + cd bingusboingus + docker pull + +# build repoUrl +# change all uppercase characters to lowercase +# strip git ref prefix from version +# strip v prefix from tag name +# zse Docker:latest tag convention +###ssh sachen +# https://github.com/appleboy/ssh-action From c63e87bc62b1d5cc6570b7728c1496aa5654aa30 Mon Sep 17 00:00:00 2001 From: lulu12329 Date: Sun, 25 Feb 2024 20:40:07 +0100 Subject: [PATCH 02/15] ops: fix githubs secret names --- .github/workflows/deploy.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 910d8c6..7d18809 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -17,9 +17,9 @@ jobs: - name: executing remote ssh commands using password uses: appleboy/ssh-action@v1.0.3 with: - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - password: ${{ secrets.PASSWORD }} + host: ${{ secrets.SERVER_HOST }} + username: ${{ secrets.SERVER_USERNAME }} + password: ${{ secrets.SERVER_PASSWORD }} port: ${{ secrets.PORT }} script: | whoami From e64738ae70925164ee0a2481b556e83f261a4f71 Mon Sep 17 00:00:00 2001 From: lulu12329 Date: Sun, 25 Feb 2024 20:51:40 +0100 Subject: [PATCH 03/15] ops: add fingerprint --- .github/workflows/deploy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7d18809..8e300dd 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -21,6 +21,7 @@ jobs: username: ${{ secrets.SERVER_USERNAME }} password: ${{ secrets.SERVER_PASSWORD }} port: ${{ secrets.PORT }} + fingerprint: ${{ secrets.SERVER_FINGERPRINT }} script: | whoami cd bingusboingus From 4c61261580d18dd4de74a57c0b3e5fb260f692be Mon Sep 17 00:00:00 2001 From: lulu12329 Date: Sun, 25 Feb 2024 21:35:49 +0100 Subject: [PATCH 04/15] ops: use ssh key --- .github/workflows/deploy.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8e300dd..ee48dd0 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -19,9 +19,13 @@ jobs: with: host: ${{ secrets.SERVER_HOST }} username: ${{ secrets.SERVER_USERNAME }} - password: ${{ secrets.SERVER_PASSWORD }} - port: ${{ secrets.PORT }} - fingerprint: ${{ secrets.SERVER_FINGERPRINT }} + # password: ${{ secrets.SERVER_PASSWORD }} + # fingerprint: ${{ secrets.SERVER_FINGERPRINT }} + + key: ${{ secrets.SERVER_KEY }} ++ passphrase: ${{ secrets.SERVER_PASSPHRASE }} + + script_stop: true script: | whoami cd bingusboingus From 37a28e1cb9388dbca5a7edeef1dec31d14e93e4c Mon Sep 17 00:00:00 2001 From: lulu12329 Date: Sun, 25 Feb 2024 21:37:07 +0100 Subject: [PATCH 05/15] ops: fix workflow yml --- .github/workflows/deploy.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ee48dd0..8dd5389 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -21,10 +21,8 @@ jobs: username: ${{ secrets.SERVER_USERNAME }} # password: ${{ secrets.SERVER_PASSWORD }} # fingerprint: ${{ secrets.SERVER_FINGERPRINT }} - key: ${{ secrets.SERVER_KEY }} -+ passphrase: ${{ secrets.SERVER_PASSPHRASE }} - + passphrase: ${{ secrets.SERVER_PASSPHRASE }} script_stop: true script: | whoami From 15884f8698c7df5af7664cb03c15d6e29b22ea68 Mon Sep 17 00:00:00 2001 From: lulu12329 Date: Sun, 25 Feb 2024 21:40:23 +0100 Subject: [PATCH 06/15] compose up --- .github/workflows/deploy.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8dd5389..9503c5f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -27,7 +27,8 @@ jobs: script: | whoami cd bingusboingus - docker pull + docker compose pull + docker compose up -d # build repoUrl # change all uppercase characters to lowercase From ba03be13516c1a02f957178faa2d498079ace549 Mon Sep 17 00:00:00 2001 From: lulu12329 Date: Sun, 25 Feb 2024 22:10:53 +0100 Subject: [PATCH 07/15] ops: rund deploy on workflow_displatch --- .github/workflows/deploy.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 9503c5f..bcb578d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,10 +1,7 @@ name: Deploy on: - push: - branches: ['deploy-pipeline'] - # tags: - # - 'v[0-9]+.[0-9]+.[0-9]+' + workflow_dispatch: jobs: deploy: @@ -19,8 +16,6 @@ jobs: with: host: ${{ secrets.SERVER_HOST }} username: ${{ secrets.SERVER_USERNAME }} - # password: ${{ secrets.SERVER_PASSWORD }} - # fingerprint: ${{ secrets.SERVER_FINGERPRINT }} key: ${{ secrets.SERVER_KEY }} passphrase: ${{ secrets.SERVER_PASSPHRASE }} script_stop: true @@ -30,10 +25,5 @@ jobs: docker compose pull docker compose up -d -# build repoUrl -# change all uppercase characters to lowercase -# strip git ref prefix from version -# strip v prefix from tag name -# zse Docker:latest tag convention ###ssh sachen # https://github.com/appleboy/ssh-action From 9a3518057132932da3ced793e33d91be2145c35b Mon Sep 17 00:00:00 2001 From: lulu12329 Date: Sun, 25 Feb 2024 22:13:07 +0100 Subject: [PATCH 08/15] ops: fix yml syntax --- .github/workflows/deploy.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index bcb578d..405fea8 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,7 +1,6 @@ name: Deploy -on: - workflow_dispatch: +on: workflow_dispatch jobs: deploy: From 0a9c4d4eacd4081133824f5bbc92e062e4609c08 Mon Sep 17 00:00:00 2001 From: lulu12329 Date: Sun, 25 Feb 2024 22:18:31 +0100 Subject: [PATCH 09/15] ops: trigger deploy after docker Image ci --- .github/workflows/deploy.yml | 6 +++++- .github/workflows/docker.yml | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 405fea8..af6a220 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,6 +1,10 @@ name: Deploy -on: workflow_dispatch +on: + workflow_run: + workflows: [Docker Image CI] + types: [completed] + branches: [deploy-pipeline] jobs: deploy: diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 5b82966..0cd566c 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -2,7 +2,7 @@ name: Docker Image CI on: push: - branches: ['dev'] + branches: ['dev', 'deploy-pipeline'] tags: - 'v[0-9]+.[0-9]+.[0-9]+' From 02df964de7ff9f1f38b3612c9effe1f10aa91cdb Mon Sep 17 00:00:00 2001 From: lulu12329 Date: Sun, 25 Feb 2024 22:25:43 +0100 Subject: [PATCH 10/15] ops: aotoTrigger try 2 --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index af6a220..379567d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -2,7 +2,7 @@ name: Deploy on: workflow_run: - workflows: [Docker Image CI] + workflows: ['Docker Image CI'] types: [completed] branches: [deploy-pipeline] From 7e49dde05163e86aafe612f1703d6b938644b47f Mon Sep 17 00:00:00 2001 From: lulu12329 Date: Sun, 25 Feb 2024 22:27:28 +0100 Subject: [PATCH 11/15] ops: ok remove branch- specification --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 379567d..f208481 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -4,7 +4,7 @@ on: workflow_run: workflows: ['Docker Image CI'] types: [completed] - branches: [deploy-pipeline] + # branches: [deploy-pipeline] jobs: deploy: From bcb837fb22d37ac3b1f6f5aaae7116393c21d5cd Mon Sep 17 00:00:00 2001 From: lulu12329 Date: Sun, 25 Feb 2024 22:48:54 +0100 Subject: [PATCH 12/15] ops: limit branches --- .github/workflows/deploy.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f208481..007204d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -2,17 +2,13 @@ name: Deploy on: workflow_run: - workflows: ['Docker Image CI'] + workflows: [Docker Image CI] types: [completed] - # branches: [deploy-pipeline] + branches: [master] jobs: deploy: runs-on: ubuntu-latest - # permissions: - # packages: write - # contents: read - steps: - name: executing remote ssh commands using password uses: appleboy/ssh-action@v1.0.3 From c69a7cf77b958d9da466b994ce0893b29375188f Mon Sep 17 00:00:00 2001 From: lulu12329 Date: Sun, 25 Feb 2024 22:51:11 +0100 Subject: [PATCH 13/15] chore(launch.json): remove custom script --- .vscode/launch.json | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index bea6a7f..0fe3ed5 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -33,21 +33,6 @@ "skipFiles": [ "/**" ] - }, - { - "type": "node", - "request": "launch", - "name": "start:lukas", - "runtimeExecutable": "npm", - "console": "integratedTerminal", - "envFile": "${workspaceFolder}/.env.lukas", - "runtimeArgs": [ - "run-script", - "start:debug" - ], - "skipFiles": [ - "/**" - ] } ] } \ No newline at end of file From f1fceb7256031856df38e4a2777281503272c80a Mon Sep 17 00:00:00 2001 From: lulu12329 Date: Sun, 25 Feb 2024 22:52:41 +0100 Subject: [PATCH 14/15] revert: .github/workflows/docker.yml --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 0cd566c..5b82966 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -2,7 +2,7 @@ name: Docker Image CI on: push: - branches: ['dev', 'deploy-pipeline'] + branches: ['dev'] tags: - 'v[0-9]+.[0-9]+.[0-9]+' From b4a7e693807a45b52a8623f1d636f574e9604523 Mon Sep 17 00:00:00 2001 From: lulu12329 Date: Sun, 25 Feb 2024 22:55:36 +0100 Subject: [PATCH 15/15] cop(deploy): remove whoami --- .github/workflows/deploy.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 007204d..3b8babe 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -19,7 +19,6 @@ jobs: passphrase: ${{ secrets.SERVER_PASSPHRASE }} script_stop: true script: | - whoami cd bingusboingus docker compose pull docker compose up -d