mirror of https://github.com/eyhc1/rendercv.git
workflows: update docs deployment
This commit is contained in:
parent
fafa4084cf
commit
503c7133b7
|
@ -1,41 +1,59 @@
|
||||||
name: Deploy documentation
|
name: Deploy the documentation
|
||||||
|
|
||||||
# GitHub events that triggers the workflow:
|
|
||||||
on:
|
on:
|
||||||
|
# Runs on pushes targeting the default branch
|
||||||
push:
|
push:
|
||||||
branches: ["main"]
|
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:
|
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:
|
jobs:
|
||||||
deploy:
|
# Build job
|
||||||
name: Deploy
|
build:
|
||||||
|
name: Build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- 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
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: 3.12
|
||||||
|
|
||||||
- name: Install Hatch
|
- name: Install Hatch
|
||||||
uses: pypa/hatch@install
|
uses: pypa/hatch@install
|
||||||
|
|
||||||
- name: Store cache ID
|
- name: Build the website
|
||||||
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
|
|
||||||
run: |
|
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
|
|
@ -99,10 +99,6 @@ These commands are defined in the [`pyproject.toml`](https://github.com/sinaatal
|
||||||
```bash
|
```bash
|
||||||
hatch run docs:build
|
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):
|
- Update [schema.json](https://github.com/sinaatalay/rendercv/blob/main/schema.json):
|
||||||
```bash
|
```bash
|
||||||
hatch run docs:update-schema
|
hatch run docs:update-schema
|
||||||
|
|
|
@ -163,8 +163,6 @@ path = ".venv-docs"
|
||||||
build = "mkdocs build --clean --strict" # hatch run docs:build
|
build = "mkdocs build --clean --strict" # hatch run docs:build
|
||||||
# Start the development server for the documentation with `mkdocs`:
|
# Start the development server for the documentation with `mkdocs`:
|
||||||
serve = "mkdocs serve" # hatch run docs:serve
|
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.json:
|
||||||
update-schema = "python docs/update_schema.py" # hatch run docs:update-schema
|
update-schema = "python docs/update_schema.py" # hatch run docs:update-schema
|
||||||
# Update `examples` folder:
|
# Update `examples` folder:
|
||||||
|
|
Loading…
Reference in New Issue