File tree Expand file tree Collapse file tree 3 files changed +60
-63
lines changed Expand file tree Collapse file tree 3 files changed +60
-63
lines changed Original file line number Diff line number Diff line change
1
+ name : Docker test suite
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+ pull_request :
8
+ workflow_dispatch :
9
+
10
+ concurrency :
11
+ group : ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
12
+ cancel-in-progress : true
13
+
14
+ jobs :
15
+ pytest :
16
+ name : Docker test build
17
+ # List of supported runners:
18
+ # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
19
+ runs-on : ubuntu-latest
20
+
21
+ steps :
22
+ - uses : actions/checkout@v4
23
+
24
+ - name : Pre-build container images
25
+ run : |
26
+ docker network create djangocmsnet
27
+ docker compose build --force-rm
28
+
29
+ - name : Run the containers
30
+ run : |
31
+ docker compose build web
32
+ docker compose up database_default -d
33
+ sleep 2s
34
+ docker compose run web python manage.py migrate
35
+ docker compose up -d
36
+
37
+ - name : ' debug: Display state and logs'
38
+ if : always()
39
+ run : |
40
+ docker compose ps
41
+ docker compose logs web
42
+ docker compose logs database_default
43
+
44
+ - name : Execute django check
45
+ run : docker compose exec -w /app web python manage.py check --deploy
46
+
47
+ - name : Execute test suite
48
+ run : docker compose exec -w /app web python manage.py test
49
+
50
+ - name : Terminate all components
51
+ if : always()
52
+ run : docker compose down -v
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
FROM python:3.11
2
+
2
3
WORKDIR /app
3
- COPY . /app
4
- RUN pip install -r requirements.txt
4
+
5
+ COPY . .
6
+
7
+ RUN python -m pip install --upgrade pip
8
+ RUN python -m pip install -r requirements.txt
9
+
5
10
RUN python manage.py collectstatic --noinput
11
+
6
12
CMD uwsgi --http=0.0.0.0:80 --module=backend.wsgi
You can’t perform that action at this time.
0 commit comments