9
9
branches :
10
10
- develop
11
11
- ' wheel/**'
12
+ - ' runci/**'
12
13
release :
13
14
types :
14
15
- created
@@ -43,19 +44,18 @@ jobs:
43
44
run : |
44
45
./.github/workflows/build-test nomypy
45
46
- name : Set up Python 3.9
46
- if : github.event_name == 'pull_request' || github.event_name == 'release' || contains(github.ref, 'refs/heads/wheel') || github.event_name == 'schedule'
47
47
uses : actions/setup-python@v4
48
48
with :
49
49
python-version : ' 3.9'
50
50
- name : Build and test including remote checks (3.9) mypy
51
- if : (matrix.os == 'macos-12') && ((github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || github.event_name == 'release' || contains(github.ref, 'refs/heads/wheel') || github.event_name == 'schedule' )
51
+ if : (matrix.os == 'macos-12') && (github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || github.event_name == 'release' || github.event_name == 'schedule' )
52
52
shell : bash
53
53
run : |
54
54
./.github/workflows/build-test mypy
55
55
env :
56
56
PYTKET_RUN_REMOTE_TESTS : 1
57
57
- name : Build and test including remote checks (3.9) nomypy
58
- if : (matrix.os != 'macos-12') && ((github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || github.event_name == 'release' || contains( github.ref, 'refs/heads/wheel') || github. event_name == 'schedule' )
58
+ if : (matrix.os != 'macos-12') && (github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || github.event_name == 'release' || github.event_name == 'schedule')
59
59
shell : bash
60
60
run : |
61
61
./.github/workflows/build-test nomypy
@@ -108,8 +108,8 @@ jobs:
108
108
password : ${{ secrets.PYPI_PYTKET_QISKIT_API_TOKEN }}
109
109
verbose : true
110
110
111
- docs :
112
- name : Build and publish docs
111
+ build_docs :
112
+ name : Build docs
113
113
if : github.event_name == 'release'
114
114
needs : publish_to_pypi
115
115
runs-on : ubuntu-22.04
@@ -127,7 +127,7 @@ jobs:
127
127
path : wheelhouse
128
128
- name : Install pip, wheel
129
129
run : pip install -U pip wheel
130
- - name : Install extensions
130
+ - name : Install extension
131
131
run : for w in `find wheelhouse/ -type f -name "*.whl"` ; do pip install $w ; done
132
132
- name : Install docs dependencies
133
133
run : |
@@ -137,20 +137,24 @@ jobs:
137
137
run : |
138
138
cd .github/workflows/docs
139
139
mkdir extensions
140
- ./build-docs -d ${GITHUB_WORKSPACE}/.github/workflows/docs/extensions
141
- - name : Configure git
142
- run : |
143
- git config --global user.email "tket-bot@cambridgequantum.com"
144
- git config --global user.name "«$GITHUB_WORKFLOW» github action"
145
- - name : Check out gh-pages branch
146
- run : git checkout gh-pages
147
- - name : Remove old docs
148
- run : git rm -r --ignore-unmatch docs/api
149
- - name : Add generated docs to repository
150
- run : |
151
- mkdir -p docs
152
- mv .github/workflows/docs/extensions docs/api
153
- git add -f docs/api
154
- git commit --allow-empty -m "Add generated documentation."
155
- - name : Publish docs
156
- run : git push origin gh-pages:gh-pages
140
+ ./build-docs -d ${GITHUB_WORKSPACE}/.github/workflows/docs/extensions/api
141
+ - name : Upload docs as artefact
142
+ uses : actions/upload-pages-artifact@v1
143
+ with :
144
+ path : .github/workflows/docs/extensions
145
+
146
+ publish_docs :
147
+ name : Publish docs
148
+ if : github.event_name == 'release'
149
+ needs : build_docs
150
+ runs-on : ubuntu-22.04
151
+ permissions :
152
+ pages : write
153
+ id-token : write
154
+ environment :
155
+ name : github-pages
156
+ url : ${{ steps.deployment.outputs.page_url }}
157
+ steps :
158
+ - name : Deploy to GitHub Pages
159
+ id : deployment
160
+ uses : actions/deploy-pages@v1
0 commit comments