generated from ita-social-projects/DevTemplate
-
Notifications
You must be signed in to change notification settings - Fork 3
31 lines (27 loc) · 1.07 KB
/
db_deploy.yaml
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
name: Postgres_Deploy
on: workflow_dispatch
env:
DBS: "${{ vars.DEV_DB }},${{ vars.PROD_DB }}"
POSTGRES_USER: ${{ vars.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
DATABASE: ${{ vars.POSTGRES_DB }}
PGADMIN_DEFAULT_EMAIL: ${{ vars.PGADMIN_DEFAULT_EMAIL }}
PGADMIN_DEFAULT_PASSWORD: ${{ secrets.PGADMIN_DEFAULT_PASSWORD }}
jobs:
deploy:
runs-on: self-hosted
steps:
- name: PreReclaim cache directory
run: chown -R 1000:1000 $HOME/actions-runner/_work/Forum/Forum/configs/postgres
- name: Checkout
uses: actions/checkout@v3
- name: Reclaim cache directory
run: chown -R 1000:1000 $HOME/actions-runner/_work/Forum/Forum/configs/postgres
- name: Docker compouse DOWN old containers
run: docker compose -f docker-compose.db.yml down -v
- name: Docker compouse UP new containers
run: docker compose -f docker-compose.db.yml up -d --build
- name: Clean up old docker resources
run: |
docker container prune -f
docker image prune -f