workflows: update docs deployment

This commit is contained in:
Sina Atalay 2024-06-28 22:42:32 +03:00
parent fafa4084cf
commit 503c7133b7
3 changed files with 40 additions and 28 deletions

View File

@ -1,41 +1,59 @@
name: Deploy documentation
name: Deploy the documentation
# GitHub events that triggers the workflow:
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
deploy:
name: Deploy
# Build job
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
python-version: 3.12
- name: Install Hatch
uses: pypa/hatch@install
- name: Store cache ID
run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- name: Create a key
uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- name: Deploy documentation
- name: Build the website
run: |
hatch run docs:deploy
hatch run docs:build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: site
# Deployment job
deploy:
name: Deploy
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

View File

@ -99,10 +99,6 @@ These commands are defined in the [`pyproject.toml`](https://github.com/sinaatal
```bash
hatch run docs:build
```
- Deploy the documentation to GitHub Pages:
```bash
hatch run docs:deploy
```
- Update [schema.json](https://github.com/sinaatalay/rendercv/blob/main/schema.json):
```bash
hatch run docs:update-schema

View File

@ -163,8 +163,6 @@ path = ".venv-docs"
build = "mkdocs build --clean --strict" # hatch run docs:build
# Start the development server for the documentation with `mkdocs`:
serve = "mkdocs serve" # hatch run docs:serve
# Deploy the documentation to docs.rendercv.com with `mkdocs`:
deploy = "mkdocs gh-deploy --force" # hatch run docs:deploy
# Update schema.json:
update-schema = "python docs/update_schema.py" # hatch run docs:update-schema
# Update `examples` folder: