forked from Qiskit/qiskit
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (49 loc) · 1.67 KB
/
docs_deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Documentation
on:
push:
branches:
- main
tags:
# Only match non-prerelease tags.
- '[0-9]+.[0-9]+.[0-9]'
workflow_dispatch:
jobs:
build:
if: github.repository_owner == 'Qiskit'
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# We need to fetch the whole history so 'reno' can do its job and we can inspect tags.
fetch-depth: 0
- uses: actions/setup-python@v5
name: Install Python
with:
# Sync with 'documentationPythonVersion' in 'azure-pipelines.yml'.
python-version: '3.9'
- name: Install dependencies
run: tools/install_ubuntu_docs_dependencies.sh
- name: Determine GitHub branch name
run: |
# Tags like 1.0.0 and 1.0.0rc1 should point to their stable branch. We do this
# to reduce the diff in the qiskit/documentation repository between generating
# the API docs from a tag release versus a workflow_dispatch.
if [[ $GITHUB_REF_NAME =~ ^([0-9]+\.[0-9]+) ]]; then
BRANCH_NAME="stable/${BASH_REMATCH[1]}"
else
BRANCH_NAME="$GITHUB_REF_NAME"
fi
echo "Using branch '${BRANCH_NAME}' for GitHub source code links"
echo "QISKIT_DOCS_GITHUB_BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
- name: Build documentation
run: tox run -e docs
- name: Store built documentation artifact
uses: actions/upload-artifact@v4
with:
name: qiskit-docs
path: |
./docs/_build/html/*
!**/.doctrees
!**/.buildinfo
if-no-files-found: error