Skip to content

Commit

Permalink
Website publish automation
Browse files Browse the repository at this point in the history
  • Loading branch information
mario4tier committed Oct 10, 2023
1 parent 6dec0aa commit efac72e
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/actions/diffs/actions.yml
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'
47 changes: 47 additions & 0 deletions .github/workflows/docs.yml
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

0 comments on commit efac72e

Please sign in to comment.