-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (62 loc) · 2.01 KB
/
build.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Build Pipeline
on:
pull_request:
branches: [ main ]
jobs:
python_django:
name: Build Django Backend
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: ./backend
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
DB_USERNAME: ${{ secrets.DB_USERNAME }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
DB_HOST: ${{ secrets.DB_HOST }}
DB_NAME: ${{ secrets.DB_NAME }}
DB_PORT: ${{ secrets.DB_PORT }}
SECRET_KEY: ${{ secrets.DJANGO_KEY }}
AWS_STORAGE_BUCKET_NAME: ${{ secrets.AWS_STORAGE_BUCKET_NAME }}
AWS_S3_REGION_NAME: ${{ secrets.AWS_S3_REGION_NAME }}
COGNITO_USER_POOL_ID: ${{ secrets.COGNITO_USER_POOL_ID }}
COGNITO_APP_CLIENT_ID: ${{ secrets.COGNITO_APP_CLIENT_ID }}
COGNITO_APP_CLIENT_SECRET: ${{ secrets.COGNITO_APP_CLIENT_SECRET }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Install pipenv
run: python -m pip install --upgrade pipenv wheel
- name: Install dependencies
run: pipenv install --deploy --dev
- name: Run linting
run: pipenv run flake8
- name: Makes sure it runs
run: pipenv run python manage.py check
- name: Run tests
run: pipenv run python manage.py test
node_react:
name: Build React Frontend
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: ./frontend
env:
REACT_APP_USER_POOL_ID: ${{ secrets.COGNITO_USER_POOL_ID }}
REACT_APP_CLIENT_ID: ${{ secrets.REACT_APP_COGNITO_CLIENT_ID }}
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'
- run: npm install
- run: npm run lint
- run: npm run build --if-present
- run: npm test