Skip to content

Commit

Permalink
Исправлены ошибки сети
Browse files Browse the repository at this point in the history
  • Loading branch information
vklachkov committed Sep 16, 2024
1 parent fc6c3e0 commit 70d22c2
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
pull_request:
branches: [ "develop" ]
types: [closed]
paths:
- "frontend/**"
- ".github/workflows/**"

env:
REGISTRY: ghcr.io
Expand Down Expand Up @@ -58,6 +61,27 @@ jobs:
steps:
- name: Get repository code
uses: actions/checkout@v4
- name: Stop all containers
uses: appleboy/ssh-action@v1.0.0
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_USERNAME }}
password: ${{ secrets.SERVER_PASSWORD }}
script: docker stop $(docker ps -a -q)
- name: Pull latest frontend image version
uses: appleboy/ssh-action@v1.0.0
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_USERNAME }}
password: ${{ secrets.SERVER_PASSWORD }}
script: docker pull ${{ env.REGISTRY }}/${{ github.repository }}-frontend:${{env.IMAGE_TAG}}
- name: Pull latest backend image version
uses: appleboy/ssh-action@v1.0.0
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_USERNAME }}
password: ${{ secrets.SERVER_PASSWORD }}
script: docker pull ${{ env.REGISTRY }}/${{ github.repository }}-backend:${{env.IMAGE_TAG}}
- name: Copy docker compose config to remote server
uses: appleboy/scp-action@v0.1.7
with:
Expand Down
10 changes: 8 additions & 2 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,19 @@ services:
- "80:80"
- "443:443"
# - "4080:8080"
networks:
- reverse_proxy
volumes:
- /etc/letsencrypt:/etc/letsencrypt
- /var/run/docker.sock:/var/run/docker.sock
- /etc/letsencrypt:/etc/letsencrypt
- /var/run/docker.sock:/var/run/docker.sock

# TODO: убрать хардкод на образ
frontend:
image: ghcr.io/vklachkov/space-fest-ui-frontend:latest
depends_on:
- backend
networks:
- reverse_proxy
labels:
- "traefik.enable=true"
- "traefik.http.routers.spacefest_frontend.rule=Host(`spacechamp-org.ru`)"
Expand All @@ -48,6 +52,7 @@ services:
volumes:
- "backend-data:/var/lib/backend"
networks:
- reverse_proxy
- postgres
labels:
- "traefik.enable=true"
Expand Down Expand Up @@ -80,6 +85,7 @@ services:
restart: unless-stopped

networks:
reverse_proxy:
postgres:

volumes:
Expand Down

0 comments on commit 70d22c2

Please sign in to comment.