Add athena book #22
Workflow file for this run
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
# Documentation and mdbook related jobs. | |
# Reference: https://github.com/paradigmxyz/reth/blob/main/.github/workflows/book.yml | |
name: book | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
paths: | |
- "book/**" | |
merge_group: | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
name: lint | |
timeout-minutes: 60 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install mdbook-linkcheck | |
run: | | |
mkdir mdbook-linkcheck | |
curl -sSL -o mdbook-linkcheck.zip https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/latest/download/mdbook-linkcheck.x86_64-unknown-linux-gnu.zip | |
unzip mdbook-linkcheck.zip -d ./mdbook-linkcheck | |
chmod +x $(pwd)/mdbook-linkcheck/mdbook-linkcheck | |
echo $(pwd)/mdbook-linkcheck >> $GITHUB_PATH | |
- name: Run linkcheck | |
working-directory: book | |
run: mdbook-linkcheck --standalone | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- name: Setup mdBook | |
uses: peaceiris/actions-mdbook@v1 | |
with: | |
# mdbook-version: '0.4.8' | |
mdbook-version: "latest" | |
- name: Build book | |
working-directory: book | |
run: mdbook build | |
- name: Setup Pages | |
uses: actions/configure-pages@v4 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
# Upload entire repository | |
path: "book/book" | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
needs: [lint, build] | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
timeout-minutes: 60 | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup mdBook | |
uses: peaceiris/actions-mdbook@v2 | |
with: | |
mdbook-version: "latest" | |
- name: Build book | |
working-directory: book | |
run: mdbook build | |
- name: Setup Pages | |
uses: actions/configure-pages@v4 | |
- name: Deploy to Staging | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./book | |
destination_dir: book/preview/${{ github.event.pull_request.number }} | |
# publish_branch: gh-pages | |
- name: Upload artifact | |
# Only deploy if a push to main | |
if: github.ref_name == 'main' && github.event_name == 'push' | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
# Upload entire repository | |
path: "book/" | |
- name: Deploy | |
id: deployment | |
# Only deploy if a push to main | |
if: github.ref_name == 'main' && github.event_name == 'push' | |
uses: actions/deploy-pages@v4 |