Repository navigation
77 lines (67 loc) · 2.15 KB
/
Copy pathdocs.yml
File metadata and controls
77 lines (67 loc) · 2.15 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
69
70
71
72
73
74
75
76
77
name: docs
# Publish the website after CI completes on main. Runs as a separate workflow
# rather than a `needs:`-gated job in ci.yml so the docs publish job can use its
# own permissions and deployment setup.
on:
workflow_run:
workflows: [CI]
types: [completed]
branches: [main]
permissions:
actions: read
contents: write
jobs:
docs:
name: docs
runs-on: ubuntu-22.04
steps:
- name: Require CI jobs to have succeeded
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
# Inspect the triggering run's jobs directly so failures are reported by
# job name instead of only through the workflow conclusion.
failed=$(gh api \
"repos/${GITHUB_REPOSITORY}/actions/runs/${{ github.event.workflow_run.id }}/jobs" \
--paginate \
--jq '.jobs[]
| select(.conclusion != "success")
| .name')
if [ -n "$failed" ]; then
echo "Not publishing: these CI jobs did not succeed:"
echo "$failed"
exit 1
fi
echo "All CI jobs succeeded; proceeding to publish."
- uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_sha }}
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- uses: quarto-dev/quarto-actions/setup@v2
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v2
with:
packages: |
any::fansi
any::htmltools
any::knitr
any::rmarkdown
- name: Build current ir
shell: bash
run: |
set -euo pipefail
cargo build --release --locked
test -x target/release/ir
./target/release/ir --help
echo "IR_BIN=$PWD/target/release/ir" >> "$GITHUB_ENV"
echo "$PWD/target/release" >> "$GITHUB_PATH"
- uses: quarto-dev/quarto-actions/publish@v2
with:
target: gh-pages
path: docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}