Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
wormtql committed May 30, 2022
2 parents 76c7e5d + f7efff1 commit 967db50
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 9 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/build_doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build docs

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

env:
CARGO_TERM_COLOR: always

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup mdbook
run: cargo install mdbook
- name: Build MONA_DSL docs
run: mdbook build mona_dsl_book
- name: Build main site docs
run: mdbook build mona_book
- name: Build core docs
run: cargo doc --manifest-path mona_core/Cargo.toml --no-deps --document-private-items --lib
- name: Create a big dir
run: mkdir dist_docs_no_ignore
- name: Copy docs
run: cp -R mona_dsl_book/book dist_docs_no_ignore/dsl && cp -R mona_book/book dist_docs_no_ignore/main && cp -R mona_core/target/doc dist_docs_no_ignore/mona_core
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: docs
path: dist_docs_no_ignore
27 changes: 18 additions & 9 deletions .github/workflows/build_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,21 @@ jobs:
name: dist
path: dist/

- name: Rename dist folder
run: mv dist dist_no_ignore
- name: Commit dist
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "ci: Update build result"
branch: dist_main
create_branch: true

- name: Deploy
uses: easingthemes/ssh-deploy@main
env:
SSH_PRIVATE_KEY: ${{ secrets.MONA_SSH_KEY }}
SOURCE: dist/
REMOTE_HOST: ${{ secrets.MONA_REMOTE_HOST }}
REMOTE_USER: ${{ secrets.MONA_REMOTE_USER }}
TARGET: ${{ secrets.MONA_TARGET }}

# - name: Rename dist folder
# run: mv dist dist_no_ignore
# - name: Commit dist
# uses: stefanzweifel/git-auto-commit-action@v4
# with:
# commit_message: "ci: Update build result"
# branch: dist_main
# create_branch: true
# push_options: "--force"

0 comments on commit 967db50

Please sign in to comment.