mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-11 22:34:04 +02:00
57 lines
1.5 KiB
YAML
57 lines
1.5 KiB
YAML
name: markdown-code-runner
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
|
|
jobs:
|
|
markdown-code-runner:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out code from GitHub
|
|
uses: actions/checkout@v6
|
|
with:
|
|
ref: ${{ github.head_ref }}
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: "3.14.2"
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v7
|
|
|
|
- name: Run markdown-code-runner
|
|
run: |
|
|
uv sync --group docs
|
|
uv pip install -e .
|
|
uv run python docs/run_markdown_code_runner.py
|
|
|
|
- name: Run update services.yaml
|
|
run: uv run python .github/update-services.py
|
|
|
|
- name: Run update strings.json
|
|
run: uv run python .github/update-strings.py
|
|
|
|
- name: Commit updated files
|
|
id: commit
|
|
run: |
|
|
git add -u .
|
|
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
|
git config --local user.name "github-actions[bot]"
|
|
if git diff --quiet && git diff --staged --quiet; then
|
|
echo "No changes, skipping commit."
|
|
echo "commit_status=skipped" >> $GITHUB_ENV
|
|
else
|
|
git commit -m "Update auto-generated content"
|
|
echo "commit_status=committed" >> $GITHUB_ENV
|
|
fi
|
|
|
|
- name: Push changes
|
|
if: env.commit_status == 'committed'
|
|
run: |
|
|
git pull --rebase
|
|
git push
|