This repository has been archived by the owner on Oct 10, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2
49 lines (46 loc) · 1.56 KB
/
gh-pages.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
name: Publish documentation to GitHub Pages
on: [push]
jobs:
build:
runs-on: ubuntu-latest
name: "Publish documentation"
steps:
- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
target: x86_64-unknown-linux-gnu
default: true
profile: default
- name: Checkout codebase
uses: actions/checkout@v4
with:
path: ./dokkoo
- name: Checkout GitHub Pages environment
uses: actions/checkout@v4
with:
ref: gh-pages
path: ./gh-pages
token: ${{ secrets.GITHUB_TOKEN }}
- name: Generate documentation
run: |
sudo apt-get -qq install tree > /dev/null
printf "Codebase:\n" && tree ./dokkoo
find ./gh-pages -mindepth 1 ! -regex '^./gh-pages/.git\(/.*\)?' -delete
cd ./dokkoo
printf "\nGenerating documentation … "
time cargo doc --no-deps --document-private-items --release --quiet
cd ../
cp -ar ./dokkoo/target/doc/* ./gh-pages
touch ./gh-pages/.nojekyll
tee -a ./gh-pages/.nojekyll > /dev/null <<EOT
EOT
printf "\nDocumentation:\n" && tree ./gh-pages
- name: Publish
run: |
cd ./gh-pages
git config --global user.name 'Dokkoo'
git config --global user.email '[email protected]'
git add -A
git diff --quiet && git diff --staged --quiet || git commit -am "Publish documentation to GitHub Pages"
git push