-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (34 loc) · 1.16 KB
/
docker.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: Docker
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
build-containers:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build and run the container
env:
FASTAPI_SECRET_KEY: ${{secrets.FASTAPI_SECRET_KEY}}
FASTAPI_HASH_ALGORITHM: ${{secrets.FASTAPI_HASH_ALGORITHM}}
ACCESS_TOKEN_EXPIRE_MINUTES: ${{secrets.ACCESS_TOKEN_EXPIRE_MINUTES}}
USER_DB_URL: ${{secrets.DOCKER_USER_DB_URL}}
FILE_DB_URL: ${{secrets.DOCKER_FILE_DB_URL}}
POSTGRES_USER: ${{secrets.POSTGRES_USER}}
POSTGRES_PASSWORD: ${{secrets.POSTGRES_PASSWORD}}
POSTGRES_DB: ${{secrets.POSTGRES_DB}}
NEXT_PUBLIC_ENVIRONMENT: ${{secrets.NEXT_PUBLIC_ENVIRONMENT}}
NEXT_PUBLIC_API_URL: ${{secrets.NEXT_PUBLIC_API_URL}}
run: |
docker-compose -f docker-compose.prod.yml up -d
sleep 30
- name: Check container status
run: docker ps -a
- name: Get container logs
run: docker-compose -f docker-compose.prod.yml logs
- name: Clean up
run: docker-compose -f docker-compose.prod.yml down