From be40c38876614b31acd9e5a845253a6e819dadcd Mon Sep 17 00:00:00 2001 From: hrnn Date: Sat, 6 Jul 2024 01:30:20 -0400 Subject: [PATCH] docs: publish documentation site --- .github/workflows/publish_docs.yml | 55 ++++++++++++++++++++++++++++++ Makefile | 4 +++ 2 files changed, 59 insertions(+) create mode 100644 .github/workflows/publish_docs.yml diff --git a/.github/workflows/publish_docs.yml b/.github/workflows/publish_docs.yml new file mode 100644 index 00000000..feb402ca --- /dev/null +++ b/.github/workflows/publish_docs.yml @@ -0,0 +1,55 @@ +name: Generate Documentation + +on: + push: + branches: + - feat/docs + +jobs: + run_script: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install poetry + run: pipx install poetry + + - name: Set up Python version + uses: actions/setup-python@v5 + with: + python-version: '3.10' + cache: 'poetry' + + - name: Install dependencies with Poetry + run: poetry install --only docs --no-interaction + + - name: Generate tutorial docs + run: | + make build/docs + + - name: Switch to page Branch + uses: actions/checkout@v3 + with: + ref: pages + clean: false + + - name: Configure Git User + run: | + git config user.name "${{ github.actor }}" + git config user.email "${{ github.actor }}@users.noreply.github.com" + + - name: Add docs to git + run: | + mv site/* . + git add . + + - name: Commit Changes + run: | + git commit -m "updated docs" + git --no-pager log -p -2 + + - name: Push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: pages \ No newline at end of file diff --git a/Makefile b/Makefile index 869ac9b1..eeef28d8 100644 --- a/Makefile +++ b/Makefile @@ -30,3 +30,7 @@ test: serve/docs: # Start the documentation server $(POETRY) run mkdocs serve + +build/docs: + # Builds the documentation + $(POETRY) run mkdocs build -d site \ No newline at end of file