Skip to content

Commit

Permalink
workflows: update schema.json, examples folder, and entry figures wit…
Browse files Browse the repository at this point in the history
…h publish.yaml
  • Loading branch information
sinaatalay committed Jun 20, 2024
1 parent 4bacff4 commit f1b4cc9
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 59 deletions.
57 changes: 2 additions & 55 deletions .github/workflows/deploy-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ permissions:

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -37,58 +38,4 @@ jobs:
- name: Deploy documentation
run: |
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
hatch run docs:deploy
50 changes: 49 additions & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish to PyPI
name: Publish to PyPI and update files

# GitHub events that triggers the workflow:
on:
Expand Down Expand Up @@ -43,3 +43,51 @@ jobs:
- name: Upload package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

update_files:
name: Update schema.json, examples, and entry figures
runs-on: ubuntu-latest
needs: [publish]

permissions:
contents: write

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: "3.12"

- name: Install Hatch
uses: pypa/hatch@install

- name: Set Git credentials
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
- name: Update schema.json
run: |
hatch run docs:update-schema
git add schema.json
git commit -m "docs: update schema.json"
- name: Update `examples` folder
run: |
hatch run docs:update-examples
git add examples/*
git commit -m "docs: update examples"
- name: Update entry figures
run: |
hatch run docs:update-entry-figures
git add docs/assets/**/*.png
git commit -m "docs: update entry figures"
- name: Push changes
run: |
git push
6 changes: 3 additions & 3 deletions docs/developer_guide/writing_documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Run the following command to update the `examples` folder.
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.
Once a new release is created on GitHub, the [`publish.yaml`](https://github.com/sinaatalay/rendercv/blob/main/.github/workflows/publish.yaml) workflow will be automatically triggered, and the `examples` folder will be updated to the most recent version.

## 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/)"

Expand All @@ -35,7 +35,7 @@ Run the following command to update the figures.
hatch run docs:update-entry-figures
```

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.
Once a new release is created on GitHub, the [`publish.yaml`](https://github.com/sinaatalay/rendercv/blob/main/.github/workflows/publish.yaml) workflow will be automatically triggered, and the figures will be updated to the most recent version.

## Updating the JSON Schema ([`schema.json`](https://github.com/sinaatalay/rendercv/blob/main/schema.json))

Expand All @@ -49,4 +49,4 @@ Run the following command to update the JSON 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.
Once a new release is created on GitHub, the [`publish.yaml`](https://github.com/sinaatalay/rendercv/blob/main/.github/workflows/publish.yaml) workflow will be automatically triggered, and `schema.json` will be updated to the most recent version.

0 comments on commit f1b4cc9

Please sign in to comment.