From 24ef6f1422c847c10b436a3a8c88704f9db3397d Mon Sep 17 00:00:00 2001 From: Jakub Jankiewicz Date: Wed, 14 Feb 2024 15:43:45 +0100 Subject: [PATCH] add github action to build docs --- .github/workflows/docs.yaml | 43 ++++++++++++++++++++++++++ docs/README.md | 2 +- docs/docusaurus.config.ts | 8 +++-- docs/src/components/Bookmark/index.tsx | 1 + 4 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/docs.yaml diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml new file mode 100644 index 000000000..163a6001f --- /dev/null +++ b/.github/workflows/docs.yaml @@ -0,0 +1,43 @@ +name: build docs + +on: + push: + paths: + - 'docs/**' + - ".github/workflows/docs.yaml" + branches: + - docusaurus + +permissions: + contents: write + + +defaults: + run: + working-directory: docs + +jobs: + deploy: + name: Build Docusaurus + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 20 + cache: npm + cache-dependency-path: docs/package-lock.json + + - name: Install dependencies + run: npm ci + + - name: Build website + run: npm run build + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs/build + user_name: github-actions[bot] + user_email: 41898282+github-actions[bot]@users.noreply.github.com diff --git a/docs/README.md b/docs/README.md index 0c6c2c27b..12e0fabe7 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,4 +1,4 @@ -# Website +# LIPS Website This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator. diff --git a/docs/docusaurus.config.ts b/docs/docusaurus.config.ts index b8b1386d3..a9722a6e1 100644 --- a/docs/docusaurus.config.ts +++ b/docs/docusaurus.config.ts @@ -8,15 +8,17 @@ const config: Config = { favicon: 'img/favicon.ico', // Set the production url of your site here - url: 'https://lips.js.org', + url: 'https://jcubic.github.io', // Set the // pathname under which your site is served // For GitHub pages deployment, it is often '//' - baseUrl: '/', + baseUrl: '/lips-website/', // GitHub pages deployment config. // If you aren't using GitHub pages, you don't need these. organizationName: 'jcubic', // Usually your GitHub org/user name. - projectName: 'lips', // Usually your repo name. + projectName: 'lips-website', // Usually your repo name. + deploymentBranch: 'docusaurus', + onBrokenLinks: 'throw', onBrokenMarkdownLinks: 'warn', diff --git a/docs/src/components/Bookmark/index.tsx b/docs/src/components/Bookmark/index.tsx index 1d739336b..0f22569b5 100644 --- a/docs/src/components/Bookmark/index.tsx +++ b/docs/src/components/Bookmark/index.tsx @@ -13,6 +13,7 @@ export default function Bookmark(): JSX.Element {