Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ terraform/
.idea/
.vscode/
**/.venv/
**/static/
alloydflanagan/static/*
!alloydflanagan/static/.keep
**/.DS_Store
**/.env*
35 changes: 35 additions & 0 deletions .github/workflows/fly-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Deploy Review App
on:
# Run this workflow on every PR event. Existing review apps will be updated when the PR is updated.
pull_request:
types: [opened, reopened, synchronize, closed]

env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
# Set these to your Fly.io organization and preferred region.
FLY_REGION: iad
FLY_ORG: personal

jobs:
review_app:
runs-on: ubuntu-latest
outputs:
url: ${{ steps.deploy.outputs.url }}
# Only run one deployment at a time per PR.
concurrency:
group: pr-${{ github.event.number }}

# Deploying apps with this "review" environment allows the URL for the app to be displayed in the PR UI.
# Feel free to change the name of this environment.
environment:
name: review
# The script in the `deploy` sets the URL output for each review app.
url: ${{ steps.deploy.outputs.url }}
steps:
- name: Get code
uses: actions/checkout@v4

- name: Deploy PR app to Fly.io
id: deploy
uses: superfly/[email protected]

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# NOTE: see also app/.gitignore
__pycache__/
.idea/
.DS_Store
secrets.txt
**/.env*

# directories w/files from old website
/public/
Expand Down
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ EXPOSE 8080
# 2. Set PORT variable that is used by Gunicorn. This should match "EXPOSE"
# command.
ENV PYTHONUNBUFFERED=1 \
PORT=8080
PORT=8080 \
DJANGO_SETTINGS_MODULE=alloydflanagan.settings.production

# Use /app folder as a directory where the source code is stored.
WORKDIR /app
Expand All @@ -33,8 +34,8 @@ WORKDIR /app
COPY app /app/

#TODO: get uv to use system python instead of downloading -- faster, more reliable.
RUN pip install --no-cache-dir uv==0.7.13 && \
uv sync --frozen
RUN pip install --no-cache-dir uv==0.7.17 && \
uv sync --frozen --no-dev

# Note: Fly automatically sets DATABASE_URL
CMD ["make", "run-server"]
6 changes: 5 additions & 1 deletion app/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# files collected by manage.py collectstatic
static/
/static/*
!/static/.keep

media/*
!media/.keep

# yarn pnp files
.pnp.*
Expand Down
2 changes: 1 addition & 1 deletion app/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PYTHON=uv run --link-mode=copy python

run-server:
$(PYTHON) manage.py migrate
$(PYTHON) manage.py collectstatic
$(PYTHON) manage.py collectstatic --no-input
uv run gunicorn --timeout 30 alloydflanagan.wsgi:application --log-file -

djhtml:
Expand Down
2 changes: 1 addition & 1 deletion app/alloydflanagan/home/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class HomePage(Page):
('text', RichTextBlock()), #probably will use custom type later
('image', ImageChooserBlock()),
('header', HeaderBlock()),
], use_json_field=True, blank=True)
], blank=True)

content_panels = Page.content_panels + [
FieldPanel("intro", classname="full"),
Expand Down
2 changes: 1 addition & 1 deletion app/alloydflanagan/search/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from django.template.response import TemplateResponse

from wagtail.models import Page
from wagtail.search.models import Query
from wagtail.contrib.search_promotions.models import Query


def search(request):
Expand Down
1 change: 1 addition & 0 deletions app/alloydflanagan/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.messages",
"wagtail.contrib.search_promotions",
"django.contrib.staticfiles",
"wagtail.contrib.forms",
"wagtail.contrib.redirects",
Expand Down
2 changes: 2 additions & 0 deletions app/alloydflanagan/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
from .local import *
except ImportError:
pass

SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY')
Empty file added app/alloydflanagan/static/.keep
Empty file.
Empty file added app/media/.keep
Empty file.
2 changes: 1 addition & 1 deletion app/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies = [
"gunicorn>=23.0.0",
"psycopg>=3.2.7",
"structlog>=25.3.0",
"wagtail<5.3",
"wagtail<6.1.0",
"whitenoise>=6.9.0",
]

Expand Down
Empty file added app/static/.keep
Empty file.
21 changes: 17 additions & 4 deletions app/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ services:
- ./app/yarn.lock:/app/yarn.lock:delegated
environment:
DATABASE_URL: postgres://wagtail:development@postgres:5432/alloydflanagan
DJANGO_SETTINGS_MODULE: alloydflanagan.settings.dev
ports:
- "8080:8080"

Expand Down