-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (53 loc) · 2.3 KB
/
django.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Django CI
on:
pull_request:
branches: [ "main", "develop" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.11]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: create env file
run: |
touch config/.env
echo "SECRET_KEY=${{ secrets.SECRET_KEY }}" >> config/.env
echo "DEBUG=${{ secrets.DEBUG }}" >> config/.env
echo "POSTGRES_DB=${{ secrets.POSTGRES_DB }}" >> config/.env
echo "POSTGRES_USER=${{ secrets.POSTGRES_USER }}" >> config/.env
echo "POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }}" >> config/.env
echo "DB_HOST=${{ secrets.DB_HOST }}" >> config/.env
echo "DB_PORT=${{ secrets.DB_PORT }}" >> config/.env
echo "AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }}" >> config/.env
echo "AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }}" >> config/.env
echo "AWS_STORAGE_BUCKET_NAME=${{ secrets.AWS_STORAGE_BUCKET_NAME }}" >> config/.env
echo "AWS_S3_REGION_NAME=${{ secrets.AWS_S3_REGION_NAME }}" >> config/.env
echo "AWS_S3_SIGNATURE_NAME=${{ secrets.AWS_S3_SIGNATURE_NAME }}" >> config/.env
echo "AWS_S3_FILE_OVERWRITE=${{ secrets.AWS_S3_FILE_OVERWRITE }}" >> config/.env
env:
SECRET_KEY: ${{ secrets.SECRET_KEY }}
DEBUG: ${{ secrets.DEBUG }}
POSTGRES_DB: ${{ secrets.POSTGRES_DB }}
POSTGRES_USER: ${{ secrets.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
DB_HOST: ${{ secrets.DB_HOST }}
DB_PORT: ${{ secrets.DB_PORT }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_STORAGE_BUCKET_NAME: ${{ secrets.AWS_STORAGE_BUCKET_NAME }}
AWS_S3_REGION_NAME: ${{ secrets.AWS_S3_REGION_NAME }}
AWS_S3_SIGNATURE_NAME: ${{ secrets.AWS_S3_SIGNATURE_NAME }}
AWS_S3_FILE_OVERWRITE: ${{ secrets.AWS_S3_FILE_OVERWRITE }}
- name: Install Dependencies
run: |
docker-compose up -d --build
- name: Run Tests
run: |
docker-compose exec -T django pytest