Skip to content

Commit 532ff2b

Browse files
committed
ci: deploy mkdocs on gh pages
1 parent f58c781 commit 532ff2b

5 files changed

Lines changed: 180 additions & 0 deletions

File tree

.github/workflows/deploy-pages.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Deploy documentation to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- hub-conhecimento
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
15+
concurrency:
16+
group: github-pages
17+
cancel-in-progress: true
18+
19+
jobs:
20+
build:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 #v7.0.0
25+
26+
- name: Setup Python
27+
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 #v6.3.0
28+
with:
29+
python-version: '3.13'
30+
31+
- name: Setup uv
32+
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 #v8.2.0
33+
with:
34+
version: latest
35+
36+
- name: Install dependencies
37+
run: uv sync --group dev --no-install-project
38+
39+
- name: Build documentation
40+
run: uv run mkdocs build
41+
42+
- name: Upload artifact
43+
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 #v5.0.0
44+
with:
45+
path: site
46+
47+
deploy:
48+
needs: build
49+
runs-on: ubuntu-latest
50+
environment:
51+
name: github-pages
52+
url: ${{ steps.deployment.outputs.page_url }}
53+
steps:
54+
- name: Deploy to GitHub Pages
55+
id: deployment
56+
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 #v5.0.0

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ clean:
1818
@echo "Cleaning generated files..."
1919
@rm -rf site
2020

21+
.PHONY: deploy
22+
deploy:
23+
@echo "Deploying documentation to GitHub Pages..."
24+
@uv run mkdocs gh-deploy --force
25+
2126
.PHONY: format
2227
format:
2328
@uv run ruff format .

RELEASING.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Deploy do site
2+
3+
Este projeto publica a documentação com MkDocs no GitHub Pages.
4+
5+
[English Version](RELEASING_EN.md)
6+
7+
## Pré-requisitos
8+
9+
- Repositório público no GitHub
10+
- Acesso para habilitar GitHub Pages
11+
- Dependências do projeto instaladas com `uv`
12+
13+
## Build local
14+
15+
Para validar o site localmente, rode:
16+
17+
```bash
18+
uv sync --group dev --no-install-project
19+
uv run mkdocs build
20+
```
21+
22+
Para subir um servidor local:
23+
24+
```bash
25+
uv run mkdocs serve
26+
```
27+
28+
## Deploy automático
29+
30+
O fluxo de publicação está configurado para rodar no GitHub Actions sempre que houver push nas branches `main` e `hub-conhecimento`.
31+
32+
O workflow gera o site estático e publica o conteúdo no GitHub Pages.
33+
34+
## Deploy manual
35+
36+
Também é possível publicar manualmente com:
37+
38+
```bash
39+
make deploy
40+
```
41+
42+
Esse comando executa:
43+
44+
```bash
45+
uv run mkdocs gh-deploy --force
46+
```
47+
48+
## Configuração no GitHub
49+
50+
1. Acesse as configurações do repositório no GitHub.
51+
2. Entre em "Pages".
52+
3. Em "Build and deployment", selecione "GitHub Actions".
53+
4. Faça o push das alterações para disparar o deploy.
54+
55+
A URL pública esperada é:
56+
57+
```text
58+
https://cumbucadev.github.io/NOSS/
59+
```

RELEASING_EN.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Site deployment
2+
3+
This project publishes the documentation with MkDocs on GitHub Pages.
4+
5+
[Versão em Português](RELEASING.md)
6+
7+
## Prerequisites
8+
9+
- Public repository on GitHub
10+
- Permission to enable GitHub Pages
11+
- Project dependencies installed with `uv`
12+
13+
## Local build
14+
15+
To validate the site locally, run:
16+
17+
```bash
18+
uv sync --group dev --no-install-project
19+
uv run mkdocs build
20+
```
21+
22+
To start a local server:
23+
24+
```bash
25+
uv run mkdocs serve
26+
```
27+
28+
## Automatic deployment
29+
30+
The publication workflow is configured to run in GitHub Actions whenever there is a push to the `main` and `hub-conhecimento` branches.
31+
32+
The workflow builds the static site and publishes it to GitHub Pages.
33+
34+
## Manual deployment
35+
36+
You can also publish manually with:
37+
38+
```bash
39+
make deploy
40+
```
41+
42+
This command runs:
43+
44+
```bash
45+
uv run mkdocs gh-deploy --force
46+
```
47+
48+
## GitHub configuration
49+
50+
1. Open the repository settings on GitHub.
51+
2. Go to "Pages".
52+
3. In "Build and deployment", select "GitHub Actions".
53+
4. Push the changes to trigger the deployment.
54+
55+
The expected public URL is:
56+
57+
```text
58+
https://cumbucadev.github.io/NOSS/
59+
```

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
site_name: NOSS
2+
site_url: https://cumbucadev.github.io/NOSS/
23
repo_url: https://github.com/cumbucadev/NOSS
34
repo_name: cumbucadev/NOSS
45
edit_uri: edit/main/docs/

0 commit comments

Comments
 (0)