Skip to content

Commit 983fe25

Browse files
Structure the new documentation
- Add support for multi-site documentation. - Add workflow to deploy to GitHub Pages.
1 parent 7db28af commit 983fe25

File tree

205 files changed

+3474
-228
lines changed

Some content is hidden

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

205 files changed

+3474
-228
lines changed

.github/workflows/main.yml

Lines changed: 36 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,17 @@ name: Main
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
publish_artifacts:
7+
description: "Publish artifacts (Y|N)"
8+
required: true
9+
default: "N"
510
release:
611
types: [published]
712
push:
813
branches:
914
- main
10-
- v1
15+
- dev
1116
paths-ignore:
1217
- README.md
1318
pull_request:
@@ -22,7 +27,7 @@ jobs:
2227
fail-fast: false
2328
matrix:
2429
os: [ubuntu-latest]
25-
python-version: ["3.11"]
30+
python-version: ["3.13"]
2631
runs-on: ${{ matrix.os }}
2732

2833
steps:
@@ -41,71 +46,49 @@ jobs:
4146
pip install -U pip
4247
pip install -r requirements.txt
4348
44-
- name: Build documentation
49+
- name: Build and pack docs
4550
run: |
46-
mkdocs build
47-
48-
- name: Fix links
49-
run: |
50-
chmod +x ./fixlinks.sh
51-
./fixlinks.sh
52-
53-
- name: Zip built files
54-
run: |
55-
mkdir -p .build/blacksheep
56-
mv site/* .build/blacksheep
57-
cd .build
58-
7z a -r site.zip blacksheep
51+
./pack.sh
5952
6053
- name: Upload distribution package
61-
uses: actions/upload-artifact@master
54+
uses: actions/upload-artifact@v4
6255
with:
63-
name: dist
64-
path: .build/site.zip
56+
name: site
57+
path: site.zip
6558

6659
publish:
60+
if: github.ref == 'refs/heads/main' || (github.event_name == 'workflow_dispatch' && github.event.inputs.publish_artifacts == 'Y')
61+
needs: build
6762
runs-on: ubuntu-latest
68-
needs: [build]
69-
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'
63+
7064
steps:
71-
- name: Download a distribution artifact
72-
uses: actions/download-artifact@v2
65+
- name: Checkout repository
66+
uses: actions/checkout@v4
7367
with:
74-
name: dist
75-
path: dist
68+
ref: gh-pages
69+
path: neoteroi
7670

77-
- name: Unzip artifacts
78-
run: |
79-
7z x -o"site" dist/site.zip
80-
81-
- name: Use Python 3.10
82-
uses: actions/setup-python@v4
71+
- name: Download artifact
72+
uses: actions/download-artifact@v4
8373
with:
84-
python-version: "3.10"
74+
name: site
75+
path: site
8576

86-
- name: Install tools
77+
- name: Unzip artifact
8778
run: |
88-
pip install pyazblob
79+
unzip site/site.zip -d site
8980
90-
- name: Publish distribution 📦 to DEV
81+
- name: Deploy to gh-pages branch
9182
run: |
92-
pyazblob upload --path site/ --account-name "$ACCOUNT_NAME" -cn "\$web" -r -f
93-
env:
94-
ACCOUNT_NAME: ${{ secrets.DEV_EUW_ACCOUNT_NAME }}
95-
PYAZ_ACCOUNT_KEY: ${{ secrets.DEV_EUW_ACCOUNT_KEY }}
83+
find neoteroi -mindepth 1 ! -name '.git' ! -name 'CNAME' ! -name 'README.md' ! -path 'neoteroi/.git/*' -exec rm -rf {} +
84+
cp -r site/site/* neoteroi/
9685
97-
- name: Publish distribution 📦 to PROD EUW
98-
if: github.ref == 'refs/heads/main'
99-
run: |
100-
pyazblob upload --path site/ --account-name "$ACCOUNT_NAME" -cn "\$web" -r -f
101-
env:
102-
ACCOUNT_NAME: ${{ secrets.PROD_EUW_ACCOUNT_NAME }}
103-
PYAZ_ACCOUNT_KEY: ${{ secrets.PROD_EUW_ACCOUNT_KEY }}
86+
cd neoteroi
87+
git config user.name "${GITHUB_ACTOR}"
88+
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
10489
105-
- name: Publish distribution 📦 to PROD USE
106-
if: github.ref == 'refs/heads/main'
107-
run: |
108-
pyazblob upload --path site/ --account-name "$ACCOUNT_NAME" -cn "\$web" -r -f
109-
env:
110-
ACCOUNT_NAME: ${{ secrets.PROD_USE_ACCOUNT_NAME }}
111-
PYAZ_ACCOUNT_KEY: ${{ secrets.PROD_USE_ACCOUNT_KEY }}
90+
git add .
91+
git commit -m "Deploy documentation on $(date -u '+%Y-%m-%d %H:%M:%S UTC')"
92+
93+
git push origin gh-pages
94+
echo "Published to gh-pages"

.gitignore

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
site
2-
32
venv
4-
53
.build
6-
74
.env
5+
site.zip
6+
deploy
7+
out
8+
.local
9+
10+
# temporary
11+
rodi
12+
shared-assets
13+
copy-shared.sh

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021 Neoteroi, Roberto Prevato (roberto.prevato@gmail.com)
3+
Copyright (c) 2021 Roberto Prevato (roberto.prevato@gmail.com)
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Makefile

Lines changed: 0 additions & 38 deletions
This file was deleted.

README.md

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,35 @@
1-
[![Main](https://github.com/Neoteroi/BlackSheep-Docs/actions/workflows/main.yml/badge.svg)](https://github.com/Neoteroi/BlackSheep-Docs/actions/workflows/main.yml)
1+
# Neoteroi documentation 📜
22

3-
# BlackSheep documentation 📜
43
This repository contains the source code of the documentation that gets
5-
published to [https://www.neoteroi.dev/blacksheep/](https://www.neoteroi.dev/blacksheep/).
4+
published to [https://www.neoteroi.dev/](https://www.neoteroi.dev/).
65

7-
This code has been previously hosted in [Azure DevOps](https://dev.azure.com/robertoprevato/BlackSheep).
6+
---
7+
8+
Work in progress. 🚧
9+
The code has been modified to unify different projects.
10+
11+
---
812

913
## How to contribute
1014

11-
The documentation uses MkDocs. For information on how to use MkDocs, refer to its
12-
documentation.
15+
The documentation uses MkDocs and Material for MkDocs. For information on how
16+
to use these tools, refer to their documentation.
1317

1418
```bash
1519
$ mkdocs serve
1620
```
1721

18-
### Environments
22+
## How to build the full site
1923

20-
Documentation can be deployed to a DEV environment (this happens when a release is
21-
created from a branch different than `main`), or a PROD environment, when a release is
22-
created from the `main` branch.
24+
- Create a Python virtual environment, activate, install the dependencies.
25+
- Use `pack.sh` to build the full site.
26+
- `cd` into the generated `site` folder.
27+
- Start a dev servers. Recommended: use `Python http.server` module.
2328

24-
* [DEV](https://neoteroideveuwstacc.z6.web.core.windows.net/blacksheep/)
25-
* [PROD](https://www.neoteroi.dev/blacksheep/)
29+
```bash
30+
./pack.sh
2631

27-
The documentation for `blacksheep` is published under the path `/blacksheep/`
28-
because the same service will be used to serve documentation for other projects,
29-
like `rodi`.
32+
cd site
33+
34+
python3.13 -m http.server 44777
35+
```

banner.xcf

-415 KB
Binary file not shown.

blacksheep/Makefile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.PHONY: build fixlinks
2+
include .env
3+
4+
build:
5+
mkdocs build
6+
./fixlinks.sh
7+
rm -rf .build
8+
mkdir -p .build/blacksheep
9+
mv site/* .build/blacksheep
10+
echo "Ready to publish"
11+
12+
13+
build-v1:
14+
mkdocs build
15+
VERSION="v1" ./fixlinks.sh
16+
rm -rf .build
17+
mkdir -p .build/blacksheep/v1
18+
mv site/* .build/blacksheep/v1
19+
echo "Ready to publish"
20+
21+
22+
clean:
23+
rm -rf site/
24+
rm -rf .build/

blacksheep/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# BlackSheep docs 📜
2+
3+
[www.neoteroi.dev](https://www.neoteroi.dev/blacksheep/).

blacksheep/archive/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Archived documentation
2+
3+
This folder contains archived documentation of the web framework, not meant
4+
to be updated.

blacksheep/archive/v1.7z

1.98 MB
Binary file not shown.

0 commit comments

Comments
 (0)