better inline books in series #34
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: | |
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 }} | |
jobs: | |
deploy: | |
runs-on: [self-hosted, linux] | |
environment: Production | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build and restart docker compose | |
run: docker compose up --build --detach --remove-orphans | |
pre: | |
uses: Lysquid/ClubBDManga/.github/workflows/dump.yml@main | |
secrets: | |
DB_PASSWORD: ${{ secrets.DB_PASSWORD }} | |
needs: deploy | |
migrate: | |
runs-on: [ self-hosted, linux ] | |
environment: Production | |
needs: pre | |
steps: | |
- name: Migrate database | |
run: docker compose run --rm app python manage.py migrate | |
post: | |
uses: Lysquid/ClubBDManga/.github/workflows/dump.yml@main | |
secrets: | |
DB_PASSWORD: ${{ secrets.DB_PASSWORD }} | |
needs: migrate |