-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
97 additions
and
107 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Publish | ||
on: | ||
workflow_dispatch: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
if: github.ref == 'refs/heads/main' | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
environment: | ||
# environment created automatically by GitHub | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Nix | ||
uses: cachix/install-nix-action@v27 | ||
with: | ||
nix_path: nixpkgs=channel:nixos-unstable | ||
|
||
- name: Build | ||
run: cd docs && nix-shell --run "mdbook build" | ||
|
||
- name: Archive book | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: book | ||
path: docs/book/* | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v1 | ||
with: | ||
path: "docs/book" | ||
|
||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v2 |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ This will create some shortcuts to run docker commands. | |
### Development setup | ||
``` | ||
docker compose --profile dev up -d --build | ||
# or dpli_dev up -d --build | ||
# or dpcli_dev up -d --build | ||
``` | ||
This will build the docker images for local development and startup everything. | ||
**NOTE**: the `docker-compose.yml` uses bind-mounts, so editing your local django files will trigger a server reload without needing to rebuild the whole image. | ||
|
@@ -32,15 +32,15 @@ The development setup will by default create a administrator user ([email protected] | |
At every container start it will apply new migrations. | ||
|
||
#### Django commands | ||
Django provides useful command line tools that can be executed with `manage.py`, to see a list of all the available commands run inside the django container `manage.py help`. | ||
Django provides useful command line tools that can be executed with `manage.py`, to see a list of all the available commands run inside the django container `src/manage.py help`. | ||
Check [Django documentation](https://docs.djangoproject.com/en/5.0/ref/django-admin/) for a list of the builtin commands. | ||
Here are some examples of how to run them from your command line: | ||
``` | ||
djcli_dev makemigrations # it will detect changes in your model files and will create SQL scripts to migrate tables accordingly | ||
``` | ||
This is actually an alias for | ||
``` | ||
docker compose --profile dev exec -it django-dev mange.py makemigrations | ||
docker compose --profile dev exec -it django-dev src/manage.py makemigrations | ||
``` | ||
|
||
You can then review the migration script created and apply it with: | ||
|
@@ -62,7 +62,7 @@ models2puml # | |
This setup will create docker images optimized for production, without devtools installed | ||
``` | ||
docker compose --profile prod up -d --build | ||
# or dpli_prod up -d --build | ||
# or dpcli_prod up -d --build | ||
``` | ||
|
||
## How to update | ||
|
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# How to document | ||
|
||
``` | ||
nix-shell | ||
mdbook serve | ||
mdbook build | ||
``` |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
with import <nixpkgs> { | ||
}; | ||
|
||
let in pkgs.mkShell rec { | ||
buildInputs = [ | ||
mdbook | ||
mdbook-kroki-preprocessor | ||
]; | ||
} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from procrastinate.contrib.django import app | ||
|
||
|
||
@app.task(name="print-hello") | ||
def print_hello(): | ||
print("hello") |