-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6dec0aa
commit efac72e
Showing
2 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Detect Changes | ||
description: Defines variables indicating the parts of the code that changed | ||
outputs: | ||
isDoc: | ||
description: True when changes happened to some documentation | ||
value: "${{ steps.diff.outputs.isDoc }}" | ||
isRust: | ||
description: True when changes happened to the Rust code | ||
value: "${{ steps.diff.outputs.isRust }}" | ||
isMove: | ||
description: True when changes happened to the Move code | ||
value: "${{ steps.diff.outputs.isMove }}" | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Detect Changes | ||
uses: dorny/[email protected] | ||
id: diff | ||
with: | ||
filters: | | ||
isRust: | ||
- 'crates/**' | ||
- '.github/workflows/rust.yml' | ||
isDoc: | ||
- 'docs/**' | ||
- 'mkdocs.yml' | ||
- '*.md' | ||
- '.github/workflows/docs.yml' | ||
isMove: | ||
- 'move/sources/**' | ||
- 'Cargo.toml' | ||
- 'Cargo.lock' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Documentation | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
types: [opened, synchronize, reopened, ready_for_review] | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
diff: | ||
runs-on: [ubuntu-latest] | ||
outputs: | ||
isDoc: ${{ steps.diff.outputs.isDoc }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Detect Changes | ||
uses: "./.github/actions/diffs" | ||
id: diff | ||
|
||
spelling: | ||
name: Lint documentation | ||
needs: diff | ||
if: needs.diff.outputs.isDoc == 'true' | ||
runs-on: [ubuntu-latest] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Spell Check Docs | ||
uses: crate-ci/typos@master | ||
with: | ||
files: ./doc ./*.md | ||
|
||
deploy: | ||
runs-on: ubuntu-latest | ||
if: github.event.repository.fork == false | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.x | ||
- run: pip install mkdocs-material | ||
- run: pip install mkdocs-git-revision-date-localized-plugin | ||
- run: pip install mkdocs-minify-plugin | ||
- run: mkdocs gh-deploy --force |