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:
|
deploy:
|
||||||
runs-on: self-hosted
|
runs-on: self-hosted
|
||||||
needs: build
|
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:
|
steps:
|
||||||
- name: Deploy container locally
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Deploy containers locally
|
||||||
run: |
|
run: |
|
||||||
echo "Deploying nyanimedb locally..."
|
cd deploy
|
||||||
docker stop nyanimedb || true
|
docker compose down || true
|
||||||
docker rm nyanimedb || true
|
docker compose up -d
|
||||||
docker run -d --name nyanimedb -p 8080:8080 nyanimedb:latest
|
|
||||||
|
|
|
||||||
|
|
@ -12,19 +12,31 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- postgres_data:/var/lib/postgresql/data
|
- postgres_data:/var/lib/postgresql/data
|
||||||
|
|
||||||
pgadmin:
|
# pgadmin:
|
||||||
image: dpage/pgadmin4:${PGADMIN_VERSION}
|
# image: dpage/pgadmin4:${PGADMIN_VERSION}
|
||||||
container_name: pgadmin
|
# container_name: pgadmin
|
||||||
restart: always
|
# restart: always
|
||||||
environment:
|
# environment:
|
||||||
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_EMAIL}
|
# PGADMIN_DEFAULT_EMAIL: ${PGADMIN_EMAIL}
|
||||||
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_PASSWORD}
|
# PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_PASSWORD}
|
||||||
ports:
|
# ports:
|
||||||
- "${PGADMIN_PORT}:80"
|
# - "${PGADMIN_PORT}:80"
|
||||||
depends_on:
|
# depends_on:
|
||||||
- postgres
|
# - postgres
|
||||||
volumes:
|
# volumes:
|
||||||
- pgadmin_data:/var/lib/pgadmin
|
# - 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:
|
volumes:
|
||||||
postgres_data:
|
postgres_data:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue