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"