upd #21
This file contains hidden or 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
| name: GHPages projects | |
| on: | |
| push: | |
| branches: [ "master" ] | |
| paths: | |
| - 'manual/**' | |
| - 'css/manual/**' | |
| - 'com.sweaxizone.metro/**' | |
| pull_request: | |
| branches: [ "master" ] | |
| paths: | |
| - 'manual/**' | |
| - 'css/manual/**' | |
| - 'com.sweaxizone.metro/**' | |
| workflow_dispatch: | |
| inputs: | |
| logLevel: | |
| description: 'Log level' | |
| required: true | |
| default: 'warning' | |
| type: choice | |
| options: | |
| - info | |
| - warning | |
| - debug | |
| tags: | |
| description: 'Build' | |
| required: false | |
| type: boolean | |
| environment: | |
| description: 'Environment to run tests against' | |
| type: environment | |
| required: false | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install mdbook | |
| run: | | |
| mkdir bin | |
| curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.5.2/mdbook-v0.5.2-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin | |
| - name: Build books | |
| run: | | |
| bin/mdbook build manual | |
| bin/mdbook build css/manual | |
| - name: Git commit report | |
| run: | | |
| shopt -s extglob | |
| rm -rf !(manual|css) | |
| rm -rf manual/!(book) | |
| rm -rf css/!(manual) | |
| rm -rf css/manual/!(book) | |
| mv -f manual/book/* manual | |
| mv -f css/manual/book/* css/manual | |
| # Git commit | |
| git config --global user.name 'matheusds4' | |
| git config --global user.email 'hydroperfox@gmail.com' | |
| git switch -C ghpages | |
| git rm -rf --cached . | |
| git add . | |
| git commit -m "Automated report" | |
| git push origin -f ghpages |