-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (64 loc) · 1.95 KB
/
rich-codex.yaml
File metadata and controls
68 lines (64 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Rich Codex
on:
push:
branches:
- main
paths:
- .github/workflows/rich-codex.yaml
- README.md
- perdoo/cli/**
pull_request:
branches:
- main
paths:
- .github/workflows/rich-codex.yaml
- README.md
- perdoo/cli/**
workflow_dispatch:
env:
PY_VERSION: "3.10"
jobs:
rich_codex:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- run: |
sudo apt install fonts-firacode
- uses: astral-sh/setup-uv@v7
with:
python-version: ${{ env.PY_VERSION }}
- name: Install project
run: uv sync --locked --dev --all-extras --group docs --managed-python
- name: Generate terminal images with rich-codex
run: uv run rich-codex
env:
CLEAN_IMG_PATHS: docs/img/*.svg
- name: Run prek
run: uv run prek run docs/
- name: Add and commit new images
shell: bash
run: |
echo "::group::Pushing any changes found"
git config --local user.name 'github-actions[bot]'
git config --local user.email 'github-actions[bot]@users.noreply.github.com'
echo "🕵️♀️ Git status after run:"
git status -s
if [[ -f created.txt || -f deleted.txt ]]; then
echo "💥 Found some changes from running rich-codex!"
[[ -f created.txt ]] && git add $(cat created.txt)
[[ -f deleted.txt ]] && git rm $(cat deleted.txt)
git commit -m "Generate new screengrabs with rich-codex"
git push
echo "🤖 Pushed commit with new changes!"
else
echo "🤫 No changes from rich-codex found!"
fi
echo "::endgroup::"
- name: Upload sync log file artifact
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: Rich-codex log file
path: rich_codex_*.log