From 417af932cb9e5b621edd89a84eb3b2419e468f1f Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 6 Feb 2024 16:15:18 +0700 Subject: [PATCH 1/2] added: ci for deployment on server --- .github/workflows/ci.yml | 23 +++++++++++++++++++++++ src/docker-compose.yml | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..fe81ca9 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,23 @@ +name: deployment on server + +on: + push: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu + + steps: + - uses: actions/checkout@v3 + + - name: update bot + uses: appleboy/ssh-action@v1.0.3 + with: + host: ${{ secrets.SERVER_HOST }} + username: ${{ secrets.SERVER_USER }} + key: ${{ secrets.SSH_PRIVATE_KEY }} + port: 22 + script: | + cd /home/deploy/vatsimbot && git pull origin main --force && cd /home/deploy/vatsimbot/src + docker-compose up -d --build diff --git a/src/docker-compose.yml b/src/docker-compose.yml index 4c96860..dc76ea9 100644 --- a/src/docker-compose.yml +++ b/src/docker-compose.yml @@ -6,4 +6,4 @@ services: context: . dockerfile: Dockerfile ports: - - "80:5000" + - "9230:5000" From b392acb52b994442918e337b8533e82a2a38a8a3 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 6 Feb 2024 16:18:48 +0700 Subject: [PATCH 2/2] fixed: incorrectly specified folder --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe81ca9..003987f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,5 +19,5 @@ jobs: key: ${{ secrets.SSH_PRIVATE_KEY }} port: 22 script: | - cd /home/deploy/vatsimbot && git pull origin main --force && cd /home/deploy/vatsimbot/src + cd /home/deploy/vatsimfox && git pull origin main --force && cd /home/deploy/vatsimfox/src docker-compose up -d --build