Fix documentation deployment via GitHub Pages (#45) #55
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: Generate Docs | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Allow only one concurrent deployment | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: true | |
| env: | |
| RUST_TOOLCHAIN_VERSION: stable | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Cache Rust crates | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| key: test-native-${{ runner.os }}-${{ env.RUST_TOOLCHAIN_VERSION }}-${{ hashFiles('native/**/Cargo.lock') }} | |
| restore-keys: | | |
| test-native-${{ runner.os }}-${{ env.RUST_TOOLCHAIN_VERSION }} | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: "${{ env.RUST_TOOLCHAIN_VERSION }}" | |
| - name: Install Erlang/OTP | |
| uses: erlef/setup-beam@v1 | |
| with: | |
| otp-version: 25.1.0 | |
| rebar3-version: '3.18.0' | |
| - name: Cache Hex packages | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.cache/rebar3/hex/hexpm/packages | |
| key: ${{ runner.os }}-hex-${{ hashFiles(format('{0}{1}', github.workspace, '/rebar.lock')) }} | |
| restore-keys: | | |
| ${{ runner.os }}-hex- | |
| - name: Generate docs | |
| run: rebar3 ex_doc | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: 'doc' | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |