-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (38 loc) · 1009 Bytes
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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