From 63ab93b47f17bf19c6ddf4d07e9c05b270d90789 Mon Sep 17 00:00:00 2001 From: Ashley Dumaine Date: Tue, 13 Feb 2024 16:40:28 -0500 Subject: [PATCH] add action for GH pages with mdbook action --- .github/workflows/gh-pages.yml | 42 ++++++++++++++++++++++++++++++++++ docs/book/book.toml | 6 +++++ 2 files changed, 48 insertions(+) create mode 100644 .github/workflows/gh-pages.yml diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml new file mode 100644 index 000000000..963af7aee --- /dev/null +++ b/.github/workflows/gh-pages.yml @@ -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: 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 diff --git a/docs/book/book.toml b/docs/book/book.toml index 608701e80..cbbac2c9b 100644 --- a/docs/book/book.toml +++ b/docs/book/book.toml @@ -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"