Skip to content

Lance/fix cd pipeline #14

Lance/fix cd pipeline

Lance/fix cd pipeline #14

Workflow file for this run

name: Build Pipeline
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
python_django:
name: Build Django Backend
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: ./backend
env:
SECRET_KEY: ${{ secrets.DJANGO_SECRET }}
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 }}
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
- uses: actions/cache@v3
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}
- 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
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