Skip to content

Commit

Permalink
Добавил пайплайн для деплоя и вынес adminer в образ
Browse files Browse the repository at this point in the history
  • Loading branch information
serdcebolit committed Jan 24, 2024
1 parent 3f3fdb4 commit f5e54c2
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 3 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Production Deploy

on:
push:
branches: [master]
workflow_run:
workflows: [Docker Image Builder]
branches: [master]
types:
- completed

jobs:
deploy:
name: Деплой на сервер
runs-on: ubuntu-latest
needs: [ docker-build ]
if: ${{ secrets.NEEED_DEPLOY }} == 'true'
steps:
- name: Пул Докер образов, git pull и перезапуск сервера
uses: appleboy/ssh-action@v0.1.10
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
port: ${{ secrets.SSH_PORT }}
script_stop: true
script: |
cd ${{ secrets.DOCKER_ENV_PATH }}
zsh sandbox stop
git reset --hard
git pull
docker-compose -f docker-compose.build.yml pull
zsh sandbox start
1 change: 1 addition & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- 'sshproxy/**'
- 'bx_installer/**'
- 'httpd/**'
- 'adminer/**'
- 'docker-compose.build.yml'

jobs:
Expand Down
4 changes: 4 additions & 0 deletions docker-compose.build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ services:
build: ./bx_installer
image: ghcr.io/serdcebolit/bx_installer:latest

adminer:
build: ./adminer
image: ghcr.io/serdcebolit/adminer:latest

#образы без xdebug
backend70:
build:
Expand Down
3 changes: 1 addition & 2 deletions docker-compose.main_proxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ services:
- "traefik.http.routers.portainer.tls.certresolver=mainresolver"

adminer:
build:
context: adminer
image: ghcr.io/serdcebolit/adminer:latest
container_name: "adminer"
restart: always
networks:
Expand Down
2 changes: 1 addition & 1 deletion sandbox
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ case $1 in
;;

start_main_proxy)
docker-compose -f docker-compose.main_proxy.yml -p main_proxy up -d --build
docker-compose -f docker-compose.main_proxy.yml -p main_proxy up -d
;;

stop_main_proxy)
Expand Down

0 comments on commit f5e54c2

Please sign in to comment.