-
Notifications
You must be signed in to change notification settings - Fork 7
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
docs(hugr-py): build and publish docs #1253
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Build and publish docs | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
# only run if there are changes in the hugr-py directory | ||
paths: | ||
- 'hugr-py/**' | ||
|
||
# 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. | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
name: Build docs. | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./hugr-py | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install poetry | ||
run: pipx install poetry | ||
- name: Set up Python '3.10' | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
cache: "poetry" | ||
- name: Install HUGR | ||
run: poetry install --with docs | ||
- name: Build docs | ||
run: | | ||
cd docs | ||
./build.sh | ||
- name: Upload artifact. | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: ./hugr-py/docs/build | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the default directory is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the default only applies for |
||
|
||
publish: | ||
name: Publish docs. | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v5 | ||
- name: Deploy to GitHub Pages. | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Redirecting to main branch</title> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="refresh" content="0; url=./main/index.html"> | ||
<link rel="canonical" href="https://cqcl.github.io/hugr/main/index.html"> | ||
</head> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{% if versions %} | ||
<h3>{{ _('Versions') }}</h3> | ||
<ul> | ||
{%- for item in versions %} | ||
<li><a href="{{ item.url }}">{{ item.name }}</a></li> | ||
{%- endfor %} | ||
</ul> | ||
{% endif %} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this all be happening in the
hugr-py
directory? Does on>push>paths do that for us?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ooooh yes good catch