From a4cbd3b1995548882c3d2138bb1c8e81bd9ce551 Mon Sep 17 00:00:00 2001 From: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com> Date: Thu, 14 Mar 2024 11:58:35 -0400 Subject: [PATCH] Turn off live preview in PRs (#600) By turning this off, we'll be able to archive https://github.com/Qiskit/gh-actions and inline it to live in the only remaining usage at qiskit/documentation. That simplifies our infra. We're not very actively developing this repository, so the live previews are less important than before. We can still easily preview docs by looking at the GitHub artifact. It's not crucial to be able to use the GitHub deployment instead. --- .dockerignore | 8 ------- .github/workflows/preview-theme.yml | 37 ----------------------------- CONTRIBUTING.md | 2 -- Dockerfile | 33 ------------------------- 4 files changed, 80 deletions(-) delete mode 100644 .dockerignore delete mode 100644 .github/workflows/preview-theme.yml delete mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index d02d4802..00000000 --- a/.dockerignore +++ /dev/null @@ -1,8 +0,0 @@ -/.tox -/.venv -/venv -/node_modules -__pycache__/ - -/example_docs/docs/stubs/ -/docs_guide diff --git a/.github/workflows/preview-theme.yml b/.github/workflows/preview-theme.yml deleted file mode 100644 index 38a5ce80..00000000 --- a/.github/workflows/preview-theme.yml +++ /dev/null @@ -1,37 +0,0 @@ -# This Action builds the example docs in pull requests so that we can view a live preview. -# It uses IBM Cloud to build the Dockerfile at the root of the repository. -# -# Due to security, this can only run on branches of qiskit-sphinx-theme, i.e. not on forks. -# We skip the actions if running on a fork. - -name: Preview - -on: - pull_request: - types: [opened, reopened, synchronize, closed] - -jobs: - setup: - if: | - (github.event.action == 'opened' || github.event.action == 'reopened' || github.event.action == 'synchronize') && - github.event.pull_request.head.repo.full_name == github.repository - uses: Qiskit/gh-actions/.github/workflows/code-engine-preview.yml@main - with: - code_engine_project: qiskit-sphinx-theme-preview - docker_image_name: qiskit-sphinx-theme - docker_image_port: "8000" - secrets: - ibmcloud_account: ${{ secrets.IBMCLOUD_ACCOUNT }} - ibmcloud_api_key: ${{ secrets.IBMCLOUD_API_KEY }} - - teardown: - if: | - github.event.action == 'closed' && - github.event.pull_request.head.repo.full_name == github.repository - uses: Qiskit/gh-actions/.github/workflows/code-engine-cleanup.yml@main - with: - code_engine_project: qiskit-sphinx-theme-preview - docker_image_name: qiskit-sphinx-theme - secrets: - ibmcloud_account: ${{ secrets.IBMCLOUD_ACCOUNT }} - ibmcloud_api_key: ${{ secrets.IBMCLOUD_API_KEY }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cb339b7c..e711e651 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -105,8 +105,6 @@ We upload the docs builds to CI. So, you can download what the site will look li 2. Open the "Summary" page with the house icon. 3. Under the "Artifacts" section, there should be a "html_docs" entry. Download it. Un-tar it, then open the `index.html` page in a browswer. -Contributors with write access can also use live previews of the docs: GitHub will deploy a website using your changes. To use live previews, push your branch to `upstream` rather than your fork. GitHub will leave a comment with the link to the site. Please prefix your branch name with your initials, e.g. `EA/add-translations`, for good Git hygiene. - ------ ## FYI: How Furo Theme Inheritance Works diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 0c814924..00000000 --- a/Dockerfile +++ /dev/null @@ -1,33 +0,0 @@ -# This code is a Qiskit project. -# -# (C) Copyright IBM 2023. -# -# This code is licensed under the Apache License, Version 2.0. You may -# obtain a copy of this license in the LICENSE.txt file in the root directory -# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. -# -# Any modifications or derivative works of this code must retain this -# copyright notice, and modified files need to carry a notice indicating -# that they have been altered from the originals. - -# This Dockerfile is used to preview the docs in pull requests via GitHub Actions. -# -# To test it out locally: -# -# 1. ❯ docker build -t sphinx-docs-preview . -# 2. ❯ docker run --rm -p 8000:8000 -t sphinx-docs-preview -# 3. Open up localhost:8000 - -FROM python:3.9 - -RUN apt-get update && apt-get install -y pandoc graphviz -RUN python -m pip install -U tox - -WORKDIR /app - -COPY . . - -RUN tox run -e docs - -EXPOSE 8000 -CMD ["python", "-m", "http.server", "-d", "example_docs/docs/_build"]