mirror of https://github.com/eyhc1/rendercv.git
workflows: automate `schema.json`, `examples` folder, and entry figures generation
This commit is contained in:
parent
a96606163d
commit
b0d96a7c73
|
@ -7,11 +7,14 @@ on:
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
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 ${{ matrix.python-version }}
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
|
@ -35,3 +38,57 @@ jobs:
|
||||||
- name: Deploy documentation
|
- name: Deploy documentation
|
||||||
run: |
|
run: |
|
||||||
hatch run docs:deploy
|
hatch run docs:deploy
|
||||||
|
|
||||||
|
- name: Update schema.json
|
||||||
|
run: |
|
||||||
|
hatch run docs:update-schema
|
||||||
|
|
||||||
|
- name: Update `examples` folder
|
||||||
|
run: |
|
||||||
|
hatch run docs:update-examples
|
||||||
|
|
||||||
|
- name: Update entry figures
|
||||||
|
run: |
|
||||||
|
hatch run docs:update-entry-figures
|
||||||
|
|
||||||
|
- name: Check if there are changes
|
||||||
|
uses: dorny/paths-filter@v3
|
||||||
|
id: changes
|
||||||
|
with:
|
||||||
|
filters: |
|
||||||
|
schema:
|
||||||
|
- schema.json
|
||||||
|
examples:
|
||||||
|
- examples/*.yaml
|
||||||
|
entry-figures:
|
||||||
|
- docs/assets/**/*.png
|
||||||
|
|
||||||
|
- name: Update schema.json
|
||||||
|
if: steps.changes.outputs.schema == 'true'
|
||||||
|
run: |
|
||||||
|
git config --global user.name "github-actions[bot]"
|
||||||
|
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
|
git add schema.json
|
||||||
|
git commit -m "docs: update schema.json"
|
||||||
|
|
||||||
|
- name: Update `examples` folder
|
||||||
|
if: steps.changes.outputs.examples == 'true'
|
||||||
|
run: |
|
||||||
|
git config --global user.name "github-actions[bot]"
|
||||||
|
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
|
git add examples/*
|
||||||
|
git commit -m "docs: update examples"
|
||||||
|
|
||||||
|
- name: Update entry figures
|
||||||
|
if: steps.changes.outputs.entry-figures == 'true'
|
||||||
|
run: |
|
||||||
|
git config --global user.name "github-actions[bot]"
|
||||||
|
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
|
git add docs/assets/**/*.png
|
||||||
|
git commit -m "docs: update entry figures"
|
||||||
|
|
||||||
|
- name: Push changes
|
||||||
|
if: steps.changes.outputs.schema == 'true' || steps.changes.outputs.examples == 'true' || steps.changes.outputs.entry-figures == 'true'
|
||||||
|
run: |
|
||||||
|
git push
|
||||||
|
|
|
@ -8,6 +8,7 @@ hatch run docs:serve
|
||||||
|
|
||||||
Once the changes are pushed to the `main` branch, the [`deploy-docs`](https://github.com/sinaatalay/rendercv/blob/main/.github/workflows/deploy-docs.yaml) workflow will be automatically triggered, and [docs.rendercv.com](https://docs.rendercv.com/) will be updated to the most recent version.
|
Once the changes are pushed to the `main` branch, the [`deploy-docs`](https://github.com/sinaatalay/rendercv/blob/main/.github/workflows/deploy-docs.yaml) workflow will be automatically triggered, and [docs.rendercv.com](https://docs.rendercv.com/) will be updated to the most recent version.
|
||||||
|
|
||||||
|
|
||||||
## Updating the [`examples`](https://github.com/sinaatalay/rendercv/tree/main/examples) folder
|
## Updating the [`examples`](https://github.com/sinaatalay/rendercv/tree/main/examples) folder
|
||||||
|
|
||||||
The `examples` folder includes example YAML files for all the built-in themes, along with their corresponding PDF outputs. Also, there are PNG files of the first pages of each theme in [`docs/assets/images`](https://github.com/sinaatalay/rendercv/tree/main/docs/assets/images). These examples are shown in [`README.md`](https://github.com/sinaatalay/rendercv/blob/main/README.md).
|
The `examples` folder includes example YAML files for all the built-in themes, along with their corresponding PDF outputs. Also, there are PNG files of the first pages of each theme in [`docs/assets/images`](https://github.com/sinaatalay/rendercv/tree/main/docs/assets/images). These examples are shown in [`README.md`](https://github.com/sinaatalay/rendercv/blob/main/README.md).
|
||||||
|
@ -20,6 +21,8 @@ Run the following command to update the `examples` folder.
|
||||||
hatch run docs:update-examples
|
hatch run docs:update-examples
|
||||||
```
|
```
|
||||||
|
|
||||||
|
The [`deploy-docs`](https://github.com/sinaatalay/rendercv/blob/main/.github/workflows/deploy-docs.yaml) workflow also updates [`examples`](https://github.com/sinaatalay/rendercv/tree/main/examples) folder after each push to the `main` branch.
|
||||||
|
|
||||||
## Updating figures of the entry types in the "[Structure of the YAML Input File](https://docs.rendercv.com/user_guide/structure_of_the_yaml_input_file/)"
|
## Updating figures of the entry types in the "[Structure of the YAML Input File](https://docs.rendercv.com/user_guide/structure_of_the_yaml_input_file/)"
|
||||||
|
|
||||||
There are example figures for each entry type for each theme in the "[Structure of the YAML Input File](https://docs.rendercv.com/user_guide/structure_of_the_yaml_input_file/)" page.
|
There are example figures for each entry type for each theme in the "[Structure of the YAML Input File](https://docs.rendercv.com/user_guide/structure_of_the_yaml_input_file/)" page.
|
||||||
|
@ -32,7 +35,9 @@ Run the following command to update the figures.
|
||||||
hatch run docs:update-entry-figures
|
hatch run docs:update-entry-figures
|
||||||
```
|
```
|
||||||
|
|
||||||
## Updating the [JSON Schema](https://github.com/sinaatalay/rendercv/blob/main/schema.json)
|
The [`deploy-docs`](https://github.com/sinaatalay/rendercv/blob/main/.github/workflows/deploy-docs.yaml) workflow also updates the figures after each push to the `main` branch.
|
||||||
|
|
||||||
|
## Updating the JSON Schema ([`schema.json`](https://github.com/sinaatalay/rendercv/blob/main/schema.json))
|
||||||
|
|
||||||
The schema of RenderCV's input file is defined using [Pydantic](https://docs.pydantic.dev/latest/). Pydantic allows automatic creation and customization of JSON schemas from Pydantic models.
|
The schema of RenderCV's input file is defined using [Pydantic](https://docs.pydantic.dev/latest/). Pydantic allows automatic creation and customization of JSON schemas from Pydantic models.
|
||||||
|
|
||||||
|
@ -43,3 +48,5 @@ Run the following command to update the JSON Schema.
|
||||||
```bash
|
```bash
|
||||||
hatch run docs:update-schema
|
hatch run docs:update-schema
|
||||||
```
|
```
|
||||||
|
|
||||||
|
The [`deploy-docs`](https://github.com/sinaatalay/rendercv/blob/main/.github/workflows/deploy-docs.yaml) workflow also updates [`schema.json`](https://github.com/sinaatalay/rendercv/blob/main/schema.json) after each push to the `main` branch.
|
Loading…
Reference in New Issue