Skip to content

Commit

Permalink
add action for GH pages with mdbook action
Browse files Browse the repository at this point in the history
  • Loading branch information
AshleyDumaine committed Feb 13, 2024
1 parent c6cd703 commit 4abf46a
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Deploy Github Pages

on:
push:
branches:
- main
paths:
- 'README.md'
- 'docs/book/**'
pull_request:
paths:
- 'README.md'
- 'docs/book/**'

jobs:
deploy:
runs-on: ubuntu-latest
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment

permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}

steps:
- uses: actions/checkout@v4

- name: Setup mdBook
uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: '0.4.37'

- run: cd docs/book && mdbook build

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/book/public
6 changes: 6 additions & 0 deletions docs/book/book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@ language = "en"
multilingual = false
src = "src"
title = "Cluster API Provider Linode Book"

[build]
build-dir = "public"

[output.html]
git-repository-url = "https://github.com/linode/cluster-api-provider-linode"

0 comments on commit 4abf46a

Please sign in to comment.