Skip to content

Commit

Permalink
Merge #5
Browse files Browse the repository at this point in the history
5: Use Github Pages action r=pietroalbini a=Hoverbear



Co-authored-by: Ana Hobden <[email protected]>
Co-authored-by: Pietro Albini <[email protected]>
  • Loading branch information
3 people authored May 23, 2024
2 parents c4e3931 + 97f14cb commit e10fc37
Showing 1 changed file with 18 additions and 22 deletions.
40 changes: 18 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

permissions:
# Allow write access to the source code to enable GitHub Pages publishing.
contents: write
contents: read

jobs:
build-test:
Expand Down Expand Up @@ -96,8 +96,6 @@ jobs:

docs:
name: Build documentation
permissions:
contents: read
runs-on: ubuntu-22.04
steps:
- name: Checkout the source code
Expand All @@ -119,13 +117,25 @@ jobs:
working-directory: ./docs
run: flake8 . --exclude .venv

- name: Upload built documentation as an artifact
uses: actions/upload-artifact@v3
- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v3
with:
name: docs
path: docs/build/html
if-no-files-found: error
retention-days: 1

deploy-docs:
if: github.event_name == 'push' && github.ref == 'refs/heads/staging'
environment:
name: github-pages
url: ${{ steps.github-pages.outputs.page_url }}
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4
id: github-pages

build-finished:
name: CI build successful
Expand All @@ -136,19 +146,5 @@ jobs:
- docs
- license
steps:
- name: Download built documentation for publishing
uses: actions/download-artifact@v3
with:
name: docs
path: /tmp/docs
if: github.event_name == 'push' && github.ref == 'refs/heads/staging'

- name: Publish the documentation to GitHub Pages
uses: ferrous-systems/shared-github-actions/github-pages@main
with:
path: /tmp/docs
token: ${{ secrets.GITHUB_TOKEN }}
if: github.event_name == 'push' && github.ref == 'refs/heads/staging'

- name: Mark the build as successful
run: exit 0

0 comments on commit e10fc37

Please sign in to comment.