Skip to content

Commit

Permalink
Added CI for rpgf3, staging, production, changed docker-compose
Browse files Browse the repository at this point in the history
  • Loading branch information
mhmdksh committed Jun 21, 2024
1 parent f560acc commit d89ee9d
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 80 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/production-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: production-deploy-pipeline

on:
push:
branches:
- master

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: SSH and Redeploy Production
uses: appleboy/[email protected]
with:
host: ${{ secrets.PROD_HOST }}
username: ${{ secrets.PROD_USERNAME }}
key: ${{ secrets.PROD_PRIVATE_KEY }}
port: ${{ secrets.SSH_PORT }}
script: |
cd rpgf4-pw-backend
docker-compose down -v
docker image prune -a --force
git checkout master
git pull origin master
docker-compose up -d --build
22 changes: 10 additions & 12 deletions .github/workflows/ci.yml → .github/workflows/rpgf3-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: deploy-pipeline
name: rpgf3-deploy-pipeline

on:
push:
branches:
- master
- rpgf3

jobs:
deploy:
Expand All @@ -18,12 +18,11 @@ jobs:
port: ${{ secrets.SSH_PORT }}
script: |
cd pw-backend
docker-compose down
git checkout master
docker-compose down -v
docker image prune -a --force
git pull origin master
docker-compose build
docker-compose up -d
git checkout rpgf3
git pull origin rpgf3
docker-compose up -d --build
- name: SSH and Redeploy Staging
uses: appleboy/[email protected]
Expand All @@ -34,9 +33,8 @@ jobs:
port: ${{ secrets.SSH_PORT }}
script: |
cd pw-backend
docker-compose down
docker-compose down -v
docker image prune -a --force
git checkout master
git pull origin master
docker-compose build
docker-compose up -d
git checkout rpgf3
git pull origin rpgf3
docker-compose up -d --build
25 changes: 25 additions & 0 deletions .github/workflows/staging-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: staging-deploy-pipeline

on:
push:
branches:
- staging

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: SSH and Redeploy Staging
uses: appleboy/[email protected]
with:
host: ${{ secrets.STAGING_HOST }}
username: ${{ secrets.STAGING_USERNAME }}
key: ${{ secrets.STAGING_PRIVATE_KEY }}
port: ${{ secrets.SSH_PORT }}
script: |
cd rpgf4-pw-backend
docker-compose down -v
docker image prune -a --force
git checkout master
git pull origin master
docker-compose up -d --build
45 changes: 0 additions & 45 deletions .github/workflows/test.yml

This file was deleted.

28 changes: 5 additions & 23 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,17 @@
version: '3.9'
version: '3'

services:
pw-backend:
build:
build:
context: .
container_name: pw-backend
container_name: rpgf4-pw-backend
restart: always
ports:
- 7071:7070
networks:
- pw-backend
volumes:
- ./data:/usr/src/app/data
caddy:
image: caddy:2-alpine
container_name: caddy
restart: always
networks:
- pw-backend
ports:
- 80:80
- 443:443
env_file:
- .env
environment:
PW_BACKEND_URL: ${PW_BACKEND_URL:-}
volumes:
- caddy_data:/data
- caddy_config:/config
- ./Caddyfile:/etc/caddy/Caddyfile

networks:
pw-backend:
volumes:
caddy_data:
caddy_config:

0 comments on commit d89ee9d

Please sign in to comment.