diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index ec375062a..c43f9094a 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -3,16 +3,43 @@ name: Docs on: push: branches: [main] + pull_request: jobs: - build-and-deploy: - name: "build & deploy" + build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Deploy docs - uses: mhausenblas/mkdocs-deploy-gh-pages@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CUSTOM_DOMAIN: docs.poac.dev + - uses: actions/setup-python@v5 + with: + python-version: '3.x' + cache: 'pip' + + - name: Install mkdocs + run: pip install mkdocs + + - name: Build docs + run: mkdocs build --strict + + deploy: + if: github.ref == 'refs/heads/main' + needs: build + + permissions: + contents: write + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: '3.x' + cache: 'pip' + + - name: Install mkdocs + run: pip install mkdocs + + - name: Publish docs + run: mkdocs gh-deploy --no-history diff --git a/.gitignore b/.gitignore index 9713abfc1..e6fe2d27f 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,6 @@ poac-out/ # Doxygen html + +# MkDocs +site/ diff --git a/docs/CNAME b/docs/CNAME new file mode 100644 index 000000000..84e23e28c --- /dev/null +++ b/docs/CNAME @@ -0,0 +1 @@ +docs.poac.dev