diff --git a/.github/workflows/build-deploy-and-preview.yaml b/.github/workflows/build-deploy-and-preview.yaml new file mode 100644 index 00000000..7348d625 --- /dev/null +++ b/.github/workflows/build-deploy-and-preview.yaml @@ -0,0 +1,37 @@ +name: Build, Deploy to GitHub Pages and Deploy PR Preview + +on: + push: + branches: + - docs/adding-docs-app + pull_request: + types: + - opened + - reopened + - synchronize + - closed + +permissions: + contents: write + pages: write + pull-requests: write + +concurrency: ci-${{ github.ref }} + +jobs: + build-deploy-and-preview: + name: Build, Deploy to GitHub Pages and Deploy PR Preview + runs-on: ubuntu-latest + steps: + - name: Set up Python 3.11 + uses: actions/setup-python@v5 + with: + python-version: 3.11 + - name: Install docs dependencies. + run: pip install -r docs/requirements-docs.txt + - name: Auto generate API Reference. + run: cd docs && pydoc-markdown + - name: Build, Deploy to GitHub Pages and Deploy PR Preview + uses: chvmvd/build-deploy-and-preview-action@v1.2.0 + with: + type: docusaurus \ No newline at end of file diff --git a/.github/workflows/deploy-docs.yaml b/.github/workflows/deploy-docs.yaml index 49c21f4b..d6d0d6be 100644 --- a/.github/workflows/deploy-docs.yaml +++ b/.github/workflows/deploy-docs.yaml @@ -4,7 +4,6 @@ on: push: branches: - docs - - docs/adding-docs-app jobs: deploy: diff --git a/docs/vame-docs-app/docusaurus.config.js b/docs/vame-docs-app/docusaurus.config.js index 9b5f35a7..ff386b64 100644 --- a/docs/vame-docs-app/docusaurus.config.js +++ b/docs/vame-docs-app/docusaurus.config.js @@ -16,7 +16,8 @@ const config = { url: 'https://ethoml.github.io', // Set the // pathname under which your site is served // For GitHub pages deployment, it is often '//' - baseUrl: '/VAME/', + // baseUrl: '/VAME/', + baseUrl: process.env.GITHUB_ACTIONS ? `${process.env.BASE_URL}/` : "/VAME/", // GitHub pages deployment config. // If you aren't using GitHub pages, you don't need these.