Skip to content

Commit 59e2055

Browse files
committed
initcom
0 parents  commit 59e2055

File tree

405 files changed

+83899
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

405 files changed

+83899
-0
lines changed

.github/workflows/docker-build.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Build, push and deploy CheatCode AI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- PRODUCTION
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
packages: write
13+
14+
jobs:
15+
build-and-push:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Get tag name
21+
shell: bash
22+
run: |
23+
if [[ "${GITHUB_REF#refs/heads/}" == "main" ]]; then
24+
echo "branch=latest" >> $GITHUB_OUTPUT
25+
echo "environment=staging" >> $GITHUB_OUTPUT
26+
elif [[ "${GITHUB_REF#refs/heads/}" == "PRODUCTION" ]]; then
27+
echo "branch=prod" >> $GITHUB_OUTPUT
28+
echo "environment=prod" >> $GITHUB_OUTPUT
29+
else
30+
echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
31+
echo "environment=staging" >> $GITHUB_OUTPUT
32+
fi
33+
id: get_tag_name
34+
35+
- name: Set up Docker Buildx
36+
uses: docker/setup-buildx-action@v3
37+
38+
- name: Log in to GitHub Container Registry
39+
uses: docker/login-action@v3
40+
with:
41+
registry: ghcr.io
42+
username: ${{ github.actor }}
43+
password: ${{ secrets.GITHUB_TOKEN }}
44+
45+
- name: Build and push Backend image
46+
uses: docker/build-push-action@v5
47+
with:
48+
context: ./backend
49+
file: ./backend/Dockerfile
50+
push: true
51+
platforms: linux/amd64
52+
tags: ghcr.io/${{ github.repository }}/backend:${{ steps.get_tag_name.outputs.branch }}
53+
cache-from: type=gha
54+
cache-to: type=gha,mode=max
55+
56+
- name: Build and push Frontend image
57+
uses: docker/build-push-action@v5
58+
with:
59+
context: ./frontend
60+
file: ./frontend/Dockerfile
61+
push: true
62+
platforms: linux/amd64
63+
tags: ghcr.io/${{ github.repository }}/frontend:${{ steps.get_tag_name.outputs.branch }}
64+
cache-from: type=gha
65+
cache-to: type=gha,mode=max
66+
67+
- name: Deploy to staging
68+
if: steps.get_tag_name.outputs.environment == 'staging'
69+
uses: appleboy/ssh-action@v1
70+
with:
71+
host: ${{ secrets.STAGING_HOST }}
72+
username: ${{ secrets.STAGING_USERNAME }}
73+
key: ${{ secrets.STAGING_KEY }}
74+
script: |
75+
cd /home/cheatcode/deployment-cheatcode
76+
git pull
77+
docker compose build
78+
docker compose up -d
79+
80+
- name: Deploy to prod
81+
if: steps.get_tag_name.outputs.environment == 'prod'
82+
uses: appleboy/ssh-action@v1
83+
with:
84+
host: ${{ secrets.PROD_HOST }}
85+
username: ${{ secrets.PROD_USERNAME }}
86+
key: ${{ secrets.PROD_KEY }}
87+
script: |
88+
cd /mnt/gluster-shared/data/infra/cheatcode-ai
89+
set -a; source .env; set +a
90+
docker stack deploy -c docker-compose.yml cheatcode-ai

.github/workflows/update-PROD.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Update PRODUCTION Branch
2+
on:
3+
workflow_dispatch:
4+
5+
permissions:
6+
contents: write
7+
8+
jobs:
9+
update-production:
10+
name: Rebase PRODUCTION to main
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
token: ${{ secrets.GITHUB_TOKEN }}
17+
- name: Configure Git
18+
run: |
19+
git config user.name "GitHub Actions"
20+
git config user.email "[email protected]"
21+
- name: Rebase PRODUCTION
22+
run: |
23+
git checkout PRODUCTION
24+
git rebase origin/main
25+
git push origin PRODUCTION --force

.gitignore

Lines changed: 271 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,271 @@
1+
.DS_Store
2+
3+
# Byte-compiled / optimized / DLL files
4+
__pycache__/
5+
*.py[cod]
6+
*$py.class
7+
8+
# C extensions
9+
*.so
10+
11+
# Distribution / packaging
12+
.Python
13+
build/
14+
develop-eggs/
15+
dist/
16+
downloads/
17+
eggs/
18+
.eggs/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
wheels/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
35+
36+
# Installer logs
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
40+
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.nox/
44+
.coverage
45+
.coverage.*
46+
.cache
47+
nosetests.xml
48+
coverage.xml
49+
*.cover
50+
*.py,cover
51+
.hypothesis/
52+
.pytest_cache/
53+
cover/
54+
55+
# Translations
56+
*.mo
57+
*.pot
58+
59+
# Django stuff:
60+
*.log
61+
local_settings.py
62+
db.sqlite3
63+
db.sqlite3-journal
64+
65+
# Flask stuff:
66+
instance/
67+
.webassets-cache
68+
69+
# Scrapy stuff:
70+
.scrapy
71+
72+
# Sphinx documentation
73+
docs/_build/
74+
75+
# Documentation folder
76+
docs/
77+
78+
# PyBuilder
79+
.pybuilder/
80+
target/
81+
82+
# Jupyter Notebook
83+
.ipynb_checkpoints
84+
85+
# IPython
86+
profile_default/
87+
ipython_config.py
88+
89+
test/
90+
tests/
91+
**/*test*.txt
92+
**/*test*.log
93+
94+
# IDE and Editor files
95+
.vscode/
96+
.idea/
97+
.claude/
98+
.cursor/
99+
.gemini/
100+
.windsurf/
101+
.aider/
102+
.continue/
103+
.copilot/
104+
*.swp
105+
*.swo
106+
*~
107+
108+
# OS generated files
109+
Thumbs.db
110+
ehthumbs.db
111+
Desktop.ini
112+
113+
# Temporary files
114+
*.tmp
115+
*.temp
116+
*.bak
117+
*.backup
118+
119+
# Cache directories
120+
.cache/
121+
.ruff_cache/
122+
node_modules/.cache/
123+
.next/cache/
124+
125+
# Lock files (keep package-lock.json but ignore others)
126+
yarn.lock
127+
pnpm-lock.yaml
128+
.pnpm-debug.log*
129+
130+
# Build artifacts
131+
.next/
132+
out/
133+
build/
134+
dist/
135+
136+
# Development and debugging
137+
.env.local
138+
.env.development.local
139+
.env.test.local
140+
.env.production.local
141+
debug.log
142+
*.debug
143+
144+
# pyenv
145+
# For a library or package, you might want to ignore these files since the code is
146+
# intended to run in multiple environments; otherwise, check them in:
147+
# .python-version
148+
149+
# pipenv
150+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
151+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
152+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
153+
# install all needed dependencies.
154+
#Pipfile.lock
155+
156+
# poetry
157+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
158+
# This is especially recommended for binary packages to ensure reproducibility, and is more
159+
# commonly ignored for libraries.
160+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
161+
#poetry.lock
162+
163+
# pdm
164+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
165+
#pdm.lock
166+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
167+
# in version control.
168+
# https://pdm.fming.dev/#use-with-ide
169+
.pdm.toml
170+
171+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
172+
__pypackages__/
173+
174+
# Celery stuff
175+
celerybeat-schedule
176+
celerybeat.pid
177+
178+
# SageMath parsed files
179+
*.sage.py
180+
181+
# Environments
182+
.env
183+
.venv
184+
env/
185+
venv/
186+
ENV/
187+
env.bak/
188+
venv.bak/
189+
190+
# Spyder project settings
191+
.spyderproject
192+
.spyproject
193+
194+
# Rope project settings
195+
.ropeproject
196+
197+
# mkdocs documentation
198+
/site
199+
200+
# mypy
201+
.mypy_cache/
202+
.dmypy.json
203+
dmypy.json
204+
205+
# Pyre type checker
206+
.pyre/
207+
208+
# pytype static type analyzer
209+
.pytype/
210+
211+
# Cython debug symbols
212+
cython_debug/
213+
214+
# PyCharm
215+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
216+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
217+
# and can be added to the global gitignore or merged into this file. For a more nuclear
218+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
219+
#.idea/
220+
221+
/threads
222+
state.json
223+
/workspace/
224+
/workspace/*
225+
/workspace/**
226+
227+
*.venvy/*
228+
*.venvy*
229+
230+
# SQLite
231+
*.db
232+
233+
# .DS_Store files
234+
.DS_Store
235+
**/.DS_Store
236+
.aider*
237+
supabase/.temp/cli-latest
238+
supabase/.temp/gotrue-version
239+
supabase/.temp/pooler-url
240+
supabase/.temp/postgres-version
241+
supabase/.temp/project-ref
242+
supabase/.temp/rest-version
243+
supabase/.temp/storage-version
244+
245+
**/.prompts/
246+
**/__pycache__/
247+
248+
.env.scripts
249+
250+
redis_data
251+
252+
.setup_progress
253+
254+
.setup_env.json
255+
256+
# MCP configuration (contains sensitive credentials)
257+
.mcp.json
258+
259+
backend/.test_token_compression.py
260+
backend/test_token_compression_data.py
261+
262+
dump.rdb
263+
264+
# Reference directories from another app (for code comparison/migration)
265+
@another app - backend/
266+
@another app - frontend/
267+
268+
another app - frontend/
269+
another app - backend/
270+
another app - backend/
271+
another app - frontend/

0 commit comments

Comments
 (0)