fix: deploy via actions
This commit is contained in:
parent
9e975a6b3d
commit
78e2864227
2 changed files with 40 additions and 18 deletions
|
|
@ -26,10 +26,20 @@ jobs:
|
|||
deploy:
|
||||
runs-on: self-hosted
|
||||
needs: build
|
||||
env:
|
||||
POSTGRES_USER: ${{ secrets.POSTGRES_USER }}
|
||||
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
|
||||
POSTGRES_DB: nyanimedb
|
||||
POSTGRES_PORT: 5432
|
||||
POSTGRES_VERSION: 18
|
||||
LOG_LEVEL: ${{ vars.LOG_LEVEL }}
|
||||
|
||||
steps:
|
||||
- name: Deploy container locally
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Deploy containers locally
|
||||
run: |
|
||||
echo "Deploying nyanimedb locally..."
|
||||
docker stop nyanimedb || true
|
||||
docker rm nyanimedb || true
|
||||
docker run -d --name nyanimedb -p 8080:8080 nyanimedb:latest
|
||||
cd deploy
|
||||
docker compose down || true
|
||||
docker compose up -d
|
||||
|
|
|
|||
|
|
@ -12,19 +12,31 @@ services:
|
|||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
|
||||
pgadmin:
|
||||
image: dpage/pgadmin4:${PGADMIN_VERSION}
|
||||
container_name: pgadmin
|
||||
restart: always
|
||||
environment:
|
||||
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_EMAIL}
|
||||
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_PASSWORD}
|
||||
ports:
|
||||
- "${PGADMIN_PORT}:80"
|
||||
depends_on:
|
||||
- postgres
|
||||
volumes:
|
||||
- pgadmin_data:/var/lib/pgadmin
|
||||
# pgadmin:
|
||||
# image: dpage/pgadmin4:${PGADMIN_VERSION}
|
||||
# container_name: pgadmin
|
||||
# restart: always
|
||||
# environment:
|
||||
# PGADMIN_DEFAULT_EMAIL: ${PGADMIN_EMAIL}
|
||||
# PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_PASSWORD}
|
||||
# ports:
|
||||
# - "${PGADMIN_PORT}:80"
|
||||
# depends_on:
|
||||
# - postgres
|
||||
# volumes:
|
||||
# - pgadmin_data:/var/lib/pgadmin
|
||||
|
||||
nyanimedb:
|
||||
image: nyanimedb:latest
|
||||
container_name: nyanimedb
|
||||
restart: always
|
||||
environment:
|
||||
LOG_LEVEL: ${LOG_LEVEL}
|
||||
ports:
|
||||
- "8080:8080"
|
||||
depends_on:
|
||||
- postgres
|
||||
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue