Skip to content

Commit

Permalink
Merge pull request #213 from djangoindia/monorepoci
Browse files Browse the repository at this point in the history
monorepo ci workflow added
  • Loading branch information
DevilsAutumn authored Nov 8, 2024
2 parents eec47b8 + 7244fe3 commit 0e8f11a
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 5 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/build.yml
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
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
![Djangoindia.org Build](https://github.com/djangoindia/djangoindia.org/actions/workflows/build.yml/badge.svg?branch=main)

<div align="center">
<img src="assets/djangoindia-logo.png" alt="Django India Logo" />
</div>
Expand Down Expand Up @@ -36,7 +38,7 @@ Join our community. Here's how you can get involved:
- **Report Issues:** Notice something not quite right? Let us know by creating an issue. Your feedback is invaluable! 🐛
- **Contribute Code:** Dive into open issues and send pull requests to help us squash bugs and implement exciting enhancements. 🛠️
- **Review Pull requests:** By actively reviewing pull requests, you can help maintain the quality and integrity of the project, while also supporting other contributors and fostering a collaborative environment within the Django India community.🕵️

Together, let's build something incredible! ✨🚀


Expand All @@ -53,7 +55,7 @@ For more details, please see our [Contributing.md](https://github.com/djangoindi
<tr>
<td align="center" width="150px">
<a href="https://github.com/ankanchanda">
<img src="https://avatars.githubusercontent.com/u/108596468?v=4" width="75" height="75"  
<img src="https://avatars.githubusercontent.com/u/108596468?v=4" width="75" height="75"  
alt="Saurabh Sharma" />
<br />
Ankan Chanda
Expand All @@ -70,7 +72,7 @@ For more details, please see our [Contributing.md](https://github.com/djangoindi
</td>
<td align="center" width="150px">
<a href="https://github.com/nikhil25803">
<img src="https://avatars.githubusercontent.com/u/93156825?v=4" width="75" height="75"  
<img src="https://avatars.githubusercontent.com/u/93156825?v=4" width="75" height="75"  
alt="Nikhil Raj" />
<br />
Nikhil Raj
Expand All @@ -87,7 +89,7 @@ For more details, please see our [Contributing.md](https://github.com/djangoindi
</td>
<td align="center" width="150px">
<a href="https://github.com/Knighthawk-Leo">
<img src="https://avatars.githubusercontent.com/u/72437494?v=4" width="75" height="75"  
<img src="https://avatars.githubusercontent.com/u/72437494?v=4" width="75" height="75"  
alt="Sanskar Dwivedi" />
<br />
Sanskar Dwivedi
Expand All @@ -104,7 +106,7 @@ For more details, please see our [Contributing.md](https://github.com/djangoindi
</td>
<td align="center" width="150px">
<a href="https://github.com/Saurabhsharma884">
<img src="https://avatars.githubusercontent.com/u/65456653?v=4" width="75" height="75"  
<img src="https://avatars.githubusercontent.com/u/65456653?v=4" width="75" height="75"  
alt="Saurabh Sharma" />
<br />
Saurabh Sharma
Expand Down

0 comments on commit 0e8f11a

Please sign in to comment.