-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (57 loc) · 1.38 KB
/
update-doc.yml
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
name: Update Docs
on:
workflow_dispatch:
inputs:
message:
required: true
env:
RUST_BACKTRACE: 1
RUSTFLAGS: '--codegen=debuginfo=0 --deny=warnings'
RUSTDOCFLAGS: '--deny=warnings'
CARGO_TERM_COLOR: always
ZNG_TP_LICENSES: false
jobs:
doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: cargo do doc
- name: upload doc
uses: actions/upload-artifact@v4
with:
name: doc
path: target/doc
- run: cargo clean
publish-doc:
runs-on: ubuntu-latest
needs: [doc]
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
repository: zng-ui/zng-ui.github.io
ref: main
token: ${{ secrets.PAGES_DOC_PUSH_TOKEN }}
- run: rm -rf doc
- uses: actions/download-artifact@v4
name: push
with:
name: doc
path: doc
- run: |
git config user.name "$(git log -n 1 --pretty=format:%an)"
git config user.email "$(git log -n 1 --pretty=format:%ae)"
git add -A
git commit -m "${{ github.event.inputs.message }}" --quiet
git push
cleanup:
runs-on: ubuntu-latest
if: always()
needs: [publish-doc]
steps:
- uses: geekyeggo/delete-artifact@v5
with:
name: |
doc
failOnError: false