Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandrKarpovich committed Oct 14, 2024
2 parents b930286 + 43f0afe commit 1ea5004
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: build
on:
push:
branches:
- "*"
- dev
- main
paths-ignore:
- "README.md"
workflow_dispatch:
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: deploy
on:
push:
branches:
- main
workflow_run:
workflows: [build]
types:
- completed
workflow_dispatch:

env:
IMAGE_TAG: ${{ github.sha }}
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
SSH_HOST: ${{ secrets.SSH_HOST }}
SSH_USER: ${{ secrets.SSH_USER }}


jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: 'command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client -y )'
- name: Set up SSH private key.
run: eval "$(ssh-agent -s)"
- run: mkdir -p ~/.ssh
- run: ssh-keyscan ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts
- run: ssh-agent -a $SSH_AUTH_SOCK > /dev/null
- run: ssh-add - <<< "${{ secrets.SSH_KEY }}"

- name: Update docker compose
run: |
ssh $SSH_USER@$SSH_HOST "cd YetAnotherCalendar/ && YET_ANOTHER_CALENDAR_VERSION=$IMAGE_TAG docker compose up -d --build"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ celerybeat.pid
*.sage.py

# Environments
.env.version
frontend/.env
.venv
env/
Expand Down
8 changes: 3 additions & 5 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
services:
api: &main_app
api:
ports:
- "8000:8000"
build:
context: backend/
dockerfile: Dockerfile
image: ghcr.io/azamatkomaev/yet_another_calendar_backend:${YET_ANOTHER_CALENDAR_VERSION:-dev}
image: ghcr.io/azamatkomaev/yet_another_calendar_backend:${YET_ANOTHER_CALENDAR_VERSION:-latest}
restart: always
volumes:
- ./backend:/app/src/
env_file:
- backend/.env
depends_on:
redis:
Expand Down Expand Up @@ -37,9 +36,8 @@ services:
build:
context: ./frontend
target: dev-run
image: ghcr.io/azamatkomaev/yet_another_calendar_frontend:${YET_ANOTHER_CALENDAR_VERSION:-dev}
image: ghcr.io/azamatkomaev/yet_another_calendar_frontend:${YET_ANOTHER_CALENDAR_VERSION:-latest}
container_name: calendar-frontend
env_file:
- frontend/.env
restart: always
volumes:
Expand Down

0 comments on commit 1ea5004

Please sign in to comment.