Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub Action for deploying docs to GitHub Pages #13

Merged
merged 1 commit into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,29 +98,25 @@ $ nox -s pre-commit -- install
1. Sign up at [PyPI].
2. Go to the Account Settings on PyPI, select Publishing,
and set up a new pending publisher as described on
[Creating a PyPI Project with a Trusted Publisher] [Trusted Publisher].
[Creating a PyPI Project with a Trusted Publisher][trusted publisher].

### TestPyPI

1. Sign up at [TestPyPI].
2. Go to the Account Settings on TestPyPI, select Publishing,
and set up a new pending publisher as described on
[Creating a PyPI Project with a Trusted Publisher] [Trusted Publisher].
[Creating a PyPI Project with a Trusted Publisher][trusted publisher].

### Codecov

1. Sign up at [Codecov].
2. Install their GitHub app.

### Read the Docs
### GitHub Pages

1. Sign up at [Read the Docs].
2. Import your GitHub repository, using the button _Import a Project_.
3. Install the GitHub webhook,
using the button _Add integration_
on the _Integrations_ tab
in the _Admin_ section of your project
on Read the Docs.
[GitHub Pages] should work out of the box. The pages are deployed to<br>
`<github username>.github.io/<repo name>` or <br>
`<github organization>.github.io/<repo name>`.

## Releasing

Expand Down Expand Up @@ -165,6 +161,7 @@ by applying labels to them, like this:
[cookiecutter]: https://github.com/cookiecutter/cookiecutter
[cruft]: https://cruft.github.io/cruft/
[github]: https://github.com/
[github pages]: https://docs.github.com/en/pages
[install-poetry.py]: https://install.python-poetry.org/
[nox]: https://nox.thea.codes/
[nox-poetry]: https://nox-poetry.readthedocs.io/
Expand Down
67 changes: 67 additions & 0 deletions {{cookiecutter.project_name}}/.github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: DeployDocs

on:
push:
branches:
- main
- master

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v3

- name: Install Poetry
run: |
pipx install --pip-args "-c .github/workflows/constraints.txt" poetry
poetry --version

- name: Set up Python
uses: actions/[email protected]
with:
python-version: "3.11"
cache: "poetry"

- name: Install dependencies
run: |
poetry install --no-root

- name: Build doc with Sphinx
run: |
poetry run sphinx-build -W docs docs/_build

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: "docs/_build"

deploy:
environment:
name: github-pages
url: {{ "${{ steps.deployment.outputs.page_url }}" }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Setup Pages
uses: actions/configure-pages@v3

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Set up Python
uses: actions/[email protected]
with:
python-version: "3.10"
python-version: "3.11"

- name: Upgrade pip
run: |
Expand Down