generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 237
52 lines (46 loc) · 1.45 KB
/
github-pages.yml
File metadata and controls
52 lines (46 loc) · 1.45 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
on:
workflow_dispatch:
push:
branches: [main]
paths:
- design/**
name: Update GitHub Pages
env:
rust_version: 1.86.0
# Allow only one doc pages build to run at a time for the entire smithy-rs repo
concurrency:
group: github-pages-yml
cancel-in-progress: true
jobs:
build-and-deploy-docs:
if: github.repository == 'smithy-lang/smithy-rs'
runs-on: ubuntu-latest
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.rust_version }}
- name: Generate docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --local user.name "AWS SDK Rust Bot"
git config --local user.email "aws-sdk-rust-primary@amazon.com"
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}
REV=$(git rev-parse --short HEAD)
pushd design &>/dev/null
cargo install mdbook
cargo install --locked mdbook-mermaid
mdbook build --dest-dir ../../output
popd &>/dev/null
git checkout --orphan github-pages
git rm --cached -r .
git clean -ffdx
mv ../output design
git add design
git commit -m "Design docs @ ${{ github.repository }}@${REV}"
git push origin github-pages --force