-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (36 loc) · 1.15 KB
/
docker-test.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
42
43
44
45
name: "Test: Create New Django Project"
on:
push:
branches:
- main
env:
PROJECT_NAME: init_test_github
PROJECT_IMAGE_NAME: "ghcr.io/asim3/${{ github.event.repository.name }}"
jobs:
docker_test:
runs-on: ubuntu-latest
name: Test on Docker
steps:
- uses: actions/checkout@v4
- name: Create New Django Project
run: if [ -x ./setup/set-new-django-project.bash ]; then echo ${PROJECT_NAME} | make init; fi;
- name: Copy Env File
run: cp ${PROJECT_NAME}/.env.sample ${PROJECT_NAME}/.env
- name: Build Docker
run: >
GIT_REF=$(git rev-parse --verify HEAD);
docker image build --no-cache
-t ${PROJECT_IMAGE_NAME}:${GIT_REF}
.
- name: Run All Django Tests
run: >
GIT_REF=$(git rev-parse --verify HEAD);
docker container run --rm
-e DJANGO_SETTINGS_MODULE=${PROJECT_NAME}.settings.docker_dev
${PROJECT_IMAGE_NAME}:${GIT_REF} 'python3 manage.py test'
- name: Debug
run: >
ls -al ./;
ls -al ./init_test_github;
ls -al ./deploy;
ls -al ./.github/workflows;