Fix CSRF validation by setting CSRF_TRUSTED_ORIGINS #74
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
name: CI | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
name: Test | |
env: | |
DJANGO_DEBUG: 'True' | |
PORT: '8000' | |
SITE_DOMAIN: 'http://localhost:8000' | |
DATABASE_URL: 'postgres://pg:passw0rd@localhost/interna' | |
services: | |
postgres: | |
image: postgres:14-alpine | |
env: | |
POSTGRES_USER: pg | |
POSTGRES_PASSWORD: passw0rd | |
POSTGRES_DB: interna | |
ports: | |
- 5432:5432 | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Run migrations | |
run: cd interna && ./manage.py migrate | |
- name: Collect static files | |
run: cd interna && ./manage.py collectstatic --noinput | |
- name: Run pytest | |
run: cd interna && pytest | |
docker_image: | |
name: Build Docker image | |
runs-on: ubuntu-latest | |
needs: [test] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build Docker image | |
run: | | |
docker build \ | |
--no-cache \ | |
-t coredump/interna:master \ | |
-t coredump/interna:latest \ | |
. | |
- name: Push Docker image (only on master) | |
if: github.ref == 'refs/heads/master' | |
run: | | |
docker login -u "${{ secrets.DOCKER_USERNAME }}" -p "${{ secrets.DOCKER_PASSWORD }}" && \ | |
docker push -a coredump/interna |