-
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (54 loc) · 2.13 KB
/
rustfava-docs.yml
File metadata and controls
64 lines (54 loc) · 2.13 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
name: Build rustfava docs
on:
workflow_dispatch:
repository_dispatch:
types: [rustfava-docs-update]
permissions:
contents: write
pull-requests: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.BOT_APP_ID }}
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
- uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
- uses: actions/checkout@v4
with:
repository: rustledger/rustfava
path: rustfava-src
- uses: actions/setup-python@v5
with:
python-version: '3.13'
- uses: astral-sh/setup-uv@v4
- name: Build docs
run: |
cd rustfava-src
touch src/rustfava/static/app.js
uv run --no-dev --group docs mkdocs build -d build/docs
- name: Copy docs
run: |
mkdir -p public/rustfava/docs
cp -r rustfava-src/build/docs/* public/rustfava/docs/
- name: Create PR
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add public/rustfava/docs
if git diff --staged --quiet; then
echo "No changes to commit"
exit 0
fi
BRANCH="rustfava-docs-update-$(date +%Y%m%d-%H%M%S)"
git checkout -b "$BRANCH"
git commit -m "docs: update rustfava documentation"
git push -u origin "$BRANCH"
gh pr create --title "docs: update rustfava documentation" --body "Automated update of rustfava documentation from upstream." --head "$BRANCH"