From cdedc2ed1153f8456b7eb6b6f3f63ec5cb8572e1 Mon Sep 17 00:00:00 2001 From: Sean-mn Date: Fri, 3 Apr 2026 00:27:45 +0900 Subject: [PATCH 1/4] =?UTF-8?q?chore:=20compose.prod.yaml=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=EC=99=B8=EB=B6=80=20DB=20=EB=B6=84=EB=A6=AC=20?= =?UTF-8?q?=EB=B0=8F=20=EB=84=A4=ED=8A=B8=EC=9B=8C=ED=81=AC=20=EA=B5=AC?= =?UTF-8?q?=EC=84=B1=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PushAndPull/appsettings.Production.json | 2 +- PushAndPull/deploy/compose.prod.yaml | 31 ++++++++----------- 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/PushAndPull/PushAndPull/appsettings.Production.json b/PushAndPull/PushAndPull/appsettings.Production.json index 87d5b2c..50154f6 100644 --- a/PushAndPull/PushAndPull/appsettings.Production.json +++ b/PushAndPull/PushAndPull/appsettings.Production.json @@ -10,7 +10,7 @@ "AppId": 480 }, "Redis": { - "ConnectionString": "127.0.0.1:6379,abortConnect=false" + "ConnectionString": "" }, "ConnectionStrings": { "Default": "" diff --git a/PushAndPull/deploy/compose.prod.yaml b/PushAndPull/deploy/compose.prod.yaml index a8de0fd..e9e8082 100644 --- a/PushAndPull/deploy/compose.prod.yaml +++ b/PushAndPull/deploy/compose.prod.yaml @@ -1,25 +1,16 @@ name: pushandpull-prod services: - pushpull-db: - image: postgres:17 - container_name: pushpull-db - environment: - POSTGRES_DB: pushpull - POSTGRES_USER: ${POSTGRES_USER} - POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} - volumes: - - postgres_data:/var/lib/postgresql/data - restart: unless-stopped - - pushpull-redis: + pushandpull-redis: image: redis:7-alpine - container_name: pushpull-redis + container_name: pushandpull-redis volumes: - redis_data:/data + networks: + - pushandpull-network restart: unless-stopped - pushpull-server: + pushandpull-server: image: seanyee1227/pushandpull-server:latest container_name: pushpull-server ports: @@ -29,12 +20,16 @@ services: - ASPNETCORE_URLS=http://+:80 - ConnectionStrings__Default=${DB_CONNECTION_STRING} - Redis__ConnectionString=${REDIS_CONNECTION_STRING} - - Steam__WebApiKey=${STEAM_WEB_API_KEY} + - Steam__WebApiKey=${STEAM_API_KEY} depends_on: - - pushpull-db - - pushpull-redis + - pushandpull-redis + networks: + - pushandpull-network restart: unless-stopped volumes: - postgres_data: redis_data: + +networks: + pushandpull-network: + driver: bridge From 94f88c55c2c7fe318e67e5187f579d9f30dba511 Mon Sep 17 00:00:00 2001 From: Sean-mn Date: Fri, 3 Apr 2026 00:27:51 +0900 Subject: [PATCH 2/4] =?UTF-8?q?chore:=20CI/CD=EB=A5=BC=20Docker=20Compose?= =?UTF-8?q?=20=EB=B0=B0=ED=8F=AC=20=EB=B0=A9=EC=8B=9D=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EC=A0=84=ED=99=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/Deploy-Server.yaml | 38 ++++++++++++++++++---------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/.github/workflows/Deploy-Server.yaml b/.github/workflows/Deploy-Server.yaml index 48c2f28..fbaf872 100644 --- a/.github/workflows/Deploy-Server.yaml +++ b/.github/workflows/Deploy-Server.yaml @@ -23,7 +23,18 @@ jobs: - name: Push Docker image run: docker push seanyee1227/pushandpull-server:latest - - name: Deploy to server via SSH + - name: Copy compose file to server + uses: appleboy/scp-action@v0.1.7 + with: + host: ${{ secrets.SSH_HOST }} + username: ${{ secrets.SSH_USERNAME }} + port: ${{ secrets.SSH_PORT }} + key: ${{ secrets.SSH_PRIVATE_KEY }} + source: "PushAndPull/deploy/compose.prod.yaml" + target: "~/deploy/" + strip_components: 2 + + - name: Deploy via Docker Compose uses: appleboy/ssh-action@v0.1.10 with: host: ${{ secrets.SSH_HOST }} @@ -31,18 +42,17 @@ jobs: port: ${{ secrets.SSH_PORT }} key: ${{ secrets.SSH_PRIVATE_KEY }} script: | - docker pull seanyee1227/pushandpull-server:latest - docker stop pushandpull-server || true - docker rm pushandpull-server || true - docker run -d \ - --name pushandpull-server \ - --restart unless-stopped \ - -p 21754:80 \ - -e ASPNETCORE_URLS=http://+:80 \ - -e ASPNETCORE_ENVIRONMENT=Production \ - -e "ConnectionStrings__Default=${{ secrets.DB_CONNECTION_STRING }}" \ - seanyee1227/pushandpull-server:latest + mkdir -p ~/deploy + + printf 'DB_CONNECTION_STRING=%s\nREDIS_CONNECTION_STRING=%s\nSTEAM_WEB_API_KEY=%s\n' \ + "${{ secrets.DB_CONNECTION_STRING }}" \ + "${{ secrets.REDIS_CONNECTION_STRING }}" \ + "${{ secrets.STEAM_WEB_API_KEY }}" \ + > ~/deploy/.env + + docker compose -f ~/deploy/compose.prod.yaml --env-file ~/deploy/.env pull + docker compose -f ~/deploy/compose.prod.yaml --env-file ~/deploy/.env up -d sleep 5 - docker ps | grep pushandpull-server - docker logs pushandpull-server --tail 20 + docker ps | grep pushpull-server + docker logs pushpull-server --tail 20 From 5c4f636f5f536de4d7871bc72be859ec89113e35 Mon Sep 17 00:00:00 2001 From: Sean-mn Date: Fri, 3 Apr 2026 10:29:16 +0900 Subject: [PATCH 3/4] =?UTF-8?q?chore:=20Steam=20WebApiKey=20=ED=94=8C?= =?UTF-8?q?=EB=A0=88=EC=9D=B4=EC=8A=A4=ED=99=80=EB=8D=94=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0=20=EB=B0=8F=20=ED=99=98=EA=B2=BD=EB=B3=80=EC=88=98?= =?UTF-8?q?=EB=AA=85=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PushAndPull/PushAndPull/appsettings.json | 2 +- PushAndPull/deploy/compose.prod.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/PushAndPull/PushAndPull/appsettings.json b/PushAndPull/PushAndPull/appsettings.json index 1ae86e3..30d31bc 100644 --- a/PushAndPull/PushAndPull/appsettings.json +++ b/PushAndPull/PushAndPull/appsettings.json @@ -7,7 +7,7 @@ }, "AllowedHosts": "*", "Steam": { - "WebApiKey": "Steam-ApiKey", + "WebApiKey": "", "AppId": 480 }, "ConnectionStrings": { diff --git a/PushAndPull/deploy/compose.prod.yaml b/PushAndPull/deploy/compose.prod.yaml index e9e8082..6b444d7 100644 --- a/PushAndPull/deploy/compose.prod.yaml +++ b/PushAndPull/deploy/compose.prod.yaml @@ -20,7 +20,7 @@ services: - ASPNETCORE_URLS=http://+:80 - ConnectionStrings__Default=${DB_CONNECTION_STRING} - Redis__ConnectionString=${REDIS_CONNECTION_STRING} - - Steam__WebApiKey=${STEAM_API_KEY} + - Steam__WebApiKey=${STEAM_WEB_API_KEY} depends_on: - pushandpull-redis networks: From 982fd16408b7950cd9f21c25835e80470d091bcd Mon Sep 17 00:00:00 2001 From: Sean-mn Date: Fri, 3 Apr 2026 13:48:58 +0900 Subject: [PATCH 4/4] =?UTF-8?q?chore:=20=EC=84=9C=EB=B2=84=20=EC=BB=A8?= =?UTF-8?q?=ED=85=8C=EC=9D=B4=EB=84=88=20=EC=9D=B4=EB=A6=84=EC=9D=84=20pus?= =?UTF-8?q?handpull-server=EB=A1=9C=20=ED=86=B5=EC=9D=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/Deploy-Server.yaml | 4 ++-- PushAndPull/deploy/compose.prod.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Deploy-Server.yaml b/.github/workflows/Deploy-Server.yaml index fbaf872..11def1c 100644 --- a/.github/workflows/Deploy-Server.yaml +++ b/.github/workflows/Deploy-Server.yaml @@ -54,5 +54,5 @@ jobs: docker compose -f ~/deploy/compose.prod.yaml --env-file ~/deploy/.env up -d sleep 5 - docker ps | grep pushpull-server - docker logs pushpull-server --tail 20 + docker ps | grep pushandpull-server + docker logs pushandpull-server --tail 20 diff --git a/PushAndPull/deploy/compose.prod.yaml b/PushAndPull/deploy/compose.prod.yaml index 6b444d7..5707b7c 100644 --- a/PushAndPull/deploy/compose.prod.yaml +++ b/PushAndPull/deploy/compose.prod.yaml @@ -12,7 +12,7 @@ services: pushandpull-server: image: seanyee1227/pushandpull-server:latest - container_name: pushpull-server + container_name: pushandpull-server ports: - "21754:80" environment: