Skip to content

Commit ba57874

Browse files
committed
[github] Automatically generate the Book
1 parent 0c849ad commit ba57874

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

.github/workflows/ci-post-land.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ env:
1515
pre_command: cd /opt/git/diem/
1616

1717
jobs:
18+
generate-documentation:
19+
name: Generate the Move Book using mdBook
20+
runs-on: ubuntu-20.04
21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.ref }}
1823
prepare:
1924
runs-on: ubuntu-20.04
2025
outputs:
@@ -50,6 +55,19 @@ jobs:
5055
uses: diem/actions/matches@faadd16607b77dfa2231a8f366883e01717b3225
5156
with:
5257
pattern: '.github/workflows/ci-post-land.yml\|.github/actions/dockerhub_login/action.yml\|docker/ci/github/Dockerfile\|scripts/dev_setup.sh\|rust-toolchain'
58+
- name: Setup mdBook
59+
uses: peaceiris/actions-mdbook@v1
60+
with:
61+
mdbook-version: '0.4.10'
62+
# mdbook-version: 'latest'
63+
64+
- run: mdbook build language/documentation/book
65+
66+
- name: Deploy
67+
uses: peaceiris/actions-gh-pages@v3
68+
with:
69+
github_token: ${{ secrets.GITHUB_TOKEN }}
70+
publish_dir: ./language/documentation/book/book
5371

5472
build_ci_base_docker_image:
5573
needs: prepare

.github/workflows/ci-test.yml renamed to .github/workflows/ci-pre-land.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
name: ci-test
1+
# CI jobs to be run upon the code lands to the main branch or GitHub Action test branches.
2+
3+
name: ci-pre-land
24

35
on:
46
push:
@@ -39,7 +41,7 @@ jobs:
3941
name: determine changes
4042
uses: diem/actions/changes@faadd16607b77dfa2231a8f366883e01717b3225
4143
with:
42-
workflow-file: ci-test.yml
44+
workflow-file: ci.yml
4345
github-token: ${{secrets.GITHUB_TOKEN}}
4446
- id: any-changes-found
4547
name: determine if there are any files listed in the CHANGES_CHANGED_FILE_OUTPUTFILE.

0 commit comments

Comments
 (0)