-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #213 from djangoindia/monorepoci
monorepo ci workflow added
- Loading branch information
Showing
2 changed files
with
89 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
name: Build CI | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
backend: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./backend | ||
services: | ||
postgres: | ||
image: postgres:13 | ||
env: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: test_db | ||
ports: | ||
- 5432:5432 | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
env: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: test_db | ||
POSTGRES_HOST: postgres | ||
POSTGRES_PORT: 5432 | ||
DJANGO_SETTINGS_MODULE: djangoindia.settings.production | ||
SECRET_KEY: test-key-not-for-production | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Install Django dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements/production.txt | ||
- name: Run Django migrations | ||
run: python manage.py migrate | ||
|
||
- name: Run Django system checks | ||
run: python manage.py check | ||
|
||
# - name: Run Django tests | ||
# run: python manage.py test | ||
# # Commented out as there are no tests currently | ||
|
||
frontend: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./frontend | ||
env: | ||
API_URL: http://localhost:8000/api/v1 | ||
NEXT_PUBLIC_API_URL: http://localhost:8000/api/v1 | ||
NEXT_PUBLIC_FRONTEND_URL: http://localhost:3000 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Run Next.js build | ||
run: npm run build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters