cron for database dump #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |