-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[infra] Use actions/deploy-pages to publish docs. (#74)
- Loading branch information
Showing
1 changed file
with
23 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,8 +109,8 @@ jobs: | |
password: ${{ secrets.PYPI_PYTKET_QUANTINUUM_API_TOKEN }} | ||
verbose: true | ||
|
||
docs: | ||
name: Build and publish docs | ||
build_docs: | ||
name: Build docs | ||
if: github.event_name == 'release' | ||
needs: publish_to_pypi | ||
runs-on: ubuntu-22.04 | ||
|
@@ -138,20 +138,24 @@ jobs: | |
run: | | ||
cd .github/workflows/docs | ||
mkdir extensions | ||
./build-docs -d ${GITHUB_WORKSPACE}/.github/workflows/docs/extensions | ||
- name: Configure git | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "«$GITHUB_WORKFLOW» github action" | ||
- name: Check out gh-pages branch | ||
run: git checkout gh-pages | ||
- name: Remove old docs | ||
run: git rm -r --ignore-unmatch docs/api | ||
- name: Add generated docs to repository | ||
run: | | ||
mkdir -p docs | ||
mv .github/workflows/docs/extensions docs/api | ||
git add -f docs/api | ||
git commit --allow-empty -m "Add generated documentation." | ||
- name: Publish docs | ||
run: git push origin gh-pages:gh-pages | ||
./build-docs -d ${GITHUB_WORKSPACE}/.github/workflows/docs/extensions/api | ||
- name: Upload docs as artefact | ||
uses: actions/upload-pages-artifact@v1 | ||
with: | ||
path: .github/workflows/docs/extensions | ||
|
||
publish_docs: | ||
name: Publish docs | ||
if: github.event_name == 'release' | ||
needs: build_docs | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
pages: write | ||
id-token: write | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v1 |