Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
vancik01 committed Feb 25, 2024
1 parent 248efe6 commit 70873f8
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
ssh -o StrictHostKeyChecking=no ${{ secrets.USERNAME }}@${{ secrets.HOST }} << 'EOF'
cd /home/my-app/fiit-mtaa-2024-server/
git pull
export DB_PASSWORD=${DB_PASSWORD}
docker compose down
docker compose up --build -d
EOF
55 changes: 27 additions & 28 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
name: Deploy to Droplet
version: '3.8'

on:
push:
branches:
- main # Or your deployment branch
services:
db:
image: postgres:13
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- my_network
ports:
- "5432:5432"
app:
build: .
ports:
- "3000:3000" # Map the port from the container to the host (adjust if your app uses a different port)
depends_on:
- db
environment:
- DATABASE_URL=postgresql://postgres:${DB_PASSWORD}@db:5432/postgres?connect_timeout=300
networks:
- my_network

jobs:
deploy:
runs-on: ubuntu-latest
volumes:
postgres_data:

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_KEY }}

- name: Deploy to Droplet
env:
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
run: |
ssh -o StrictHostKeyChecking=no ${{ secrets.USERNAME }}@${{ secrets.HOST }} << 'EOF'
cd /home/my-app/fiit-mtaa-2024-server/
git pull
export DB_PASSWORD=${DB_PASSWORD}
docker compose down
docker compose up --build -d
EOF
networks:
my_network:
driver: bridge

0 comments on commit 70873f8

Please sign in to comment.