Skip to content

Commit

Permalink
Deploy frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
ltan02 committed Feb 4, 2024
1 parent d4261db commit c7649d5
Show file tree
Hide file tree
Showing 8 changed files with 102 additions and 115 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
name: Build Pipeline for Python and Django
name: Backend Build Pipeline

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_call:
inputs:
pythonVersion:
required: true
type: string
secrets:
SECRET_KEY:
required: true
AWS_ACCESS_KEY_ID:
required: true
AWS_SECRET_ACCESS_KEY:
required: true
AWS_STORAGE_BUCKET_NAME:
required: true
AWS_S3_REGION_NAME:
required: true

jobs:
build:
Expand All @@ -15,7 +27,7 @@ jobs:
working-directory: ./backend

env:
SECRET_KEY: ${{ secrets.DJANGO_SECRET }}
SECRET_KEY: ${{ secrets.SECRET_KEY }}
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 }}
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Build

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
call-backend-build:
uses: ./.github/workflows/backend/build.yml
with:
pythonVersion: '3.10'
secrets:
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 }}

call-frontend-build:
uses: ./.github/workflows/frontend/build.yml
with:
nodeVersion: '20.x'
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: Build Pipeline for Node and React
name: Frontend Build Pipeline

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_call:
inputs:
nodeVersion:
required: true
type: string

jobs:
build:
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Deploy Frontend

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14'

- name: Install dependencies
run: npm install

- name: Build app
run: npm run build

- name: Upload to S3
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read
env:
SOURCE_DIR: build/
AWS_S3_BUCKET: ${{ secrets.AWS_S3_FRONTEND_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
37 changes: 18 additions & 19 deletions backend/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []
ALLOWED_HOSTS = ["*"]


# Application definition
Expand Down Expand Up @@ -93,27 +93,26 @@

WSGI_APPLICATION = "core.wsgi.application"


# Database
# https://docs.djangoproject.com/en/4.2/ref/settings/#databases
""""""
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": os.path.join(BASE_DIR, "db.sqlite3"),
},
}

"""
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': env("DB_NAME"),
'USER': env("DB_USER"),
'PASSWORD': env("DB_PASSWORD"),
'HOST': env("DB_HOST"),
'PORT': env("DB_PORT"),
if env("ENVIRONMENT") == 'prod':
DATABASES = {
"default": {
'ENGINE': 'django.db.backends.postgresql',
'NAME': os.environ.get('RDS_DB_NAME', 'your_database_name'),
'USER': os.environ.get('RDS_USERNAME', 'your_username'),
'PASSWORD': os.environ.get('RDS_PASSWORD', 'your_password'),
'HOST': os.environ.get('RDS_HOSTNAME', 'your_rds_endpoint'),
'PORT': os.environ.get('RDS_PORT', '5432'),
}
}
else: # Assuming 'dev' or any other value will use SQLite
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": os.path.join(BASE_DIR, "db.sqlite3"),
},
}
"""

# Password validation
# https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators
Expand Down
Empty file removed frontend/src/hooks/.keep
Empty file.
85 changes: 0 additions & 85 deletions frontend/src/pages/BidderLogInPage.jsx

This file was deleted.

Empty file removed frontend/src/utils/.keep
Empty file.

0 comments on commit c7649d5

Please sign in to comment.