-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (62 loc) · 1.93 KB
/
deploy.yml
File metadata and controls
76 lines (62 loc) · 1.93 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
name: Deploy
on: [workflow_dispatch]
env:
LANGUAGES: en ru
MDBOOK_VERSION: 0.5.1
jobs:
deploy:
name: Run tests
runs-on: ubuntu-latest
permissions:
contents: write # To push a branch
pages: write # To push to a GitHub Pages site
id-token: write # To update the deployment status
steps:
- uses: actions/checkout@v4
with:
# We need the full history below.
fetch-depth: 0
- name: Update rustup
run: rustup self update
- name: Install Rust
run: |
rustup set profile minimal
rustup toolchain install nightly -c rust-docs
rustup default nightly
- name: Install mdbook
run: |
mkdir bin
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v${MDBOOK_VERSION}/mdbook-v${MDBOOK_VERSION}-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
echo "$(pwd)/bin" >> ${GITHUB_PATH}
- name: Install mdbook-i18n-helpers
run: |
cargo install mdbook-i18n-helpers --locked --version 0.4.0
- name: Report versions
run: |
rustup --version
rustc -Vv
mdbook --version
- name: Run tests
run: mdbook test
- name: Build HTML
run: mdbook build
- name: Build all translations
run: |
for po_lang in ${{ env.LANGUAGES }}; do
echo "::group::Building $po_lang translation"
# Set language and adjust site URL. Clear the redirects
# since they are in sync with the source files, not the
# translation.
MDBOOK_BOOK__LANGUAGE=$po_lang \
mdbook build -d book/$po_lang
echo "::endgroup::"
done
- name: Configure GitHub Pages
uses: actions/configure-pages@v5
- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v4
with:
path: book
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4