diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml deleted file mode 100644 index 07deac7..0000000 --- a/.github/workflows/documentation.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Build and Deploy Documentation - -on: - push: - branches: - - main - pull_request: - branches: - - main - -permissions: - contents: read - pages: write - id-token: write - -concurrency: - group: "pages" - cancel-in-progress: false - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up Conda - uses: conda-incubator/setup-miniconda@v3 - with: - environment-file: environment.yml - - name: Build documentation - shell: bash -l {0} - run: make html - - - name: Upload artifact - uses: actions/upload-pages-artifact@v4 - with: - path: 'build/html' - - deploy: - if: github.ref == 'refs/heads/main' && github.event_name == 'push' - needs: build - runs-on: ubuntu-latest - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v2 \ No newline at end of file diff --git a/.github/workflows/sphinx.yml b/.github/workflows/sphinx.yml new file mode 100644 index 0000000..4732470 --- /dev/null +++ b/.github/workflows/sphinx.yml @@ -0,0 +1,33 @@ +name: "Sphinx: Render docs" + +on: push + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + - name: Set up conda + uses: conda-incubator/setup-miniconda@v3 + with: + auto-activate-base: true + activate-environment: tfe-docs + environment-file: environment.yml + - name: Build HTML + shell: bash -l {0} + run: cd docs && make html + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: html-docs + path: docs/build/html/ + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + if: github.ref == 'refs/heads/main' + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: docs/build/html \ No newline at end of file diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..b507a95 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = . +BUILDDIR = build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file diff --git a/doc/_static/logo.png b/docs/_static/logo.png similarity index 100% rename from doc/_static/logo.png rename to docs/_static/logo.png diff --git a/doc/conf.py b/docs/conf.py similarity index 100% rename from doc/conf.py rename to docs/conf.py diff --git a/doc/contributing/index.md b/docs/contributing/index.md similarity index 100% rename from doc/contributing/index.md rename to docs/contributing/index.md diff --git a/doc/contributing/setting_up.md b/docs/contributing/setting_up.md similarity index 100% rename from doc/contributing/setting_up.md rename to docs/contributing/setting_up.md diff --git a/doc/examples/index.md b/docs/examples/index.md similarity index 100% rename from doc/examples/index.md rename to docs/examples/index.md diff --git a/doc/examples/intro.md b/docs/examples/intro.md similarity index 100% rename from doc/examples/intro.md rename to docs/examples/intro.md diff --git a/doc/examples/qubit.md b/docs/examples/qubit.md similarity index 100% rename from doc/examples/qubit.md rename to docs/examples/qubit.md diff --git a/doc/index.md b/docs/index.md similarity index 100% rename from doc/index.md rename to docs/index.md