File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ .git
2+ __pycache__
3+ * .pyc
4+ * .pyo
5+ .venv
6+ .env
7+ * .sqlite3
8+ .github
9+ .gitignore
10+ README.md
11+ CONTRIBUTING.md
12+ CODE_OF_CONDUCT.md
13+ LICENSE
14+ * .md
15+ .pytest_cache
16+ .ruff_cache
17+ node_modules
Original file line number Diff line number Diff line change 44 branches :
55 - staging
66 - main
7+ paths-ignore :
8+ - ' README.md'
9+ - ' docs/**'
10+ - ' scripts/**'
11+ - ' .github/ISSUE_TEMPLATE/**'
12+
13+ concurrency :
14+ group : deploy-${{ github.ref_name }}
15+ cancel-in-progress : true
716
817jobs :
918 build :
@@ -14,21 +23,32 @@ jobs:
1423 with :
1524 username : ${{ secrets.DOCKERHUB_USERNAME }}
1625 password : ${{ secrets.DOCKERHUB_TOKEN }}
17- - name : Set Docker image tag
18- run : |
26+ - name : Login to GHCR
27+ uses : docker/login-action@v2
28+ with :
29+ registry : ghcr.io
30+ username : ${{ github.actor }}
31+ password : ${{ secrets.GITHUB_TOKEN }}
32+ - name : Set image tags
33+ run : |
1934 echo "GITHUB_REF = $GITHUB_REF" > version.py
2035 echo "GITHUB_SHA = $GITHUB_SHA" >> version.py
21-
36+
2237 if [[ $GITHUB_REF == refs/heads/main ]]; then
23- echo "DOCKER_IMAGE_TAG= latest" >> $GITHUB_ENV
38+ echo "IMAGE_TAGS=eepmoody/open5e-api: latest" >> $GITHUB_ENV
2439 elif [[ $GITHUB_REF == refs/heads/staging ]]; then
25- echo "DOCKER_IMAGE_TAG=staging" >> $GITHUB_ENV
40+ {
41+ echo "IMAGE_TAGS<<EOF"
42+ echo "eepmoody/open5e-api:staging"
43+ echo "ghcr.io/open5e/open5e-api:beta"
44+ echo "EOF"
45+ } >> $GITHUB_ENV
2646 fi
2747 - name : Build and push
2848 uses : docker/build-push-action@v7
2949 with :
3050 push : true
31- tags : eepmoody/open5e-api: ${{ env.DOCKER_IMAGE_TAG }}
51+ tags : ${{ env.IMAGE_TAGS }}
3252
3353 deploy :
3454 runs-on : ubuntu-latest
Original file line number Diff line number Diff line change 2121 run : uv python install 3.11
2222 - name : Install dependencies
2323 run : uv sync
24+ - name : Check migrations are up to date
25+ run : uv run python manage.py makemigrations --check --dry-run
2426 - name : Run migrations
2527 run : uv run python manage.py quicksetup --noindex
2628 - name : Run Tests
Original file line number Diff line number Diff line change @@ -14,8 +14,16 @@ FROM python:3.11-slim
1414
1515WORKDIR /opt/services/open5e-api
1616
17- COPY --from=builder /build/.venv /opt/services/open5e-api/.venv
18- COPY --from=builder /build /opt/services/open5e-api
17+ COPY --from=builder /build/.venv ./.venv
18+ COPY --from=builder /build/server ./server
19+ COPY --from=builder /build/api ./api
20+ COPY --from=builder /build/api_v2 ./api_v2
21+ COPY --from=builder /build/search ./search
22+ COPY --from=builder /build/templates ./templates
23+ COPY --from=builder /build/staticfiles ./staticfiles
24+ COPY --from=builder /build/db.sqlite3 ./db.sqlite3
25+ COPY --from=builder /build/manage.py ./manage.py
26+ COPY --from=builder /build/newrelic.ini ./newrelic.ini
1927
2028ENV PATH="/opt/services/open5e-api/.venv/bin:$PATH"
2129
Original file line number Diff line number Diff line change @@ -94,7 +94,6 @@ def migrate_db() -> None:
9494 This command is added primarily to assist in local development, because
9595 checking out and changing branches results in unclean model/dbs."""
9696
97- call_command ('makemigrations' )
9897 call_command ('migrate' )
9998
10099def is_dirty () -> None :
Original file line number Diff line number Diff line change 121121 "default" : {
122122 "ENGINE" : "django.db.backends.sqlite3" ,
123123 "NAME" : os .path .join (BASE_DIR , "db.sqlite3" ),
124+ "OPTIONS" : {
125+ "init_command" : (
126+ "PRAGMA journal_mode=WAL;"
127+ "PRAGMA synchronous=NORMAL;"
128+ "PRAGMA cache_size=-65536;"
129+ "PRAGMA temp_store=MEMORY;"
130+ ),
131+ },
124132 }
125133}
126134
You can’t perform that action at this time.
0 commit comments