Skip to content

auto mariadb dumps

auto mariadb dumps #14

Workflow file for this run

name: Deploy on VPS
on:
push:
branches:
- main
workflow_dispatch:
jobs:
deploy:
runs-on: [self-hosted, linux]
environment: Production
steps:
- uses: actions/checkout@v3
- name: Build, restart docker compose and migrate
run: |
docker compose up --build --detach --remove-orphans
docker exec clubbdmanga-db-1 mariadb-dump -u $DB_USER --password=$DB_PASSWORD $DB_NAME > ~/bdmanga_dump_before.sql
docker compose run app python manage.py migrate
docker exec clubbdmanga-db-1 mariadb-dump -u $DB_USER --password=$DB_PASSWORD $DB_NAME > ~/bdmanga_dump_after.sql
env:
DB_NAME: ${{ vars.DB_NAME }}
DB_USER: ${{ vars.DB_USER }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
EMAIL: ${{ vars.EMAIL }}
SITE_URL: ${{ vars.SITE_URL }}
SECRET_KEY: ${{ secrets.SECRET_KEY }}