Skip to content

Commit

Permalink
Merge pull request #475 from materialsproject/1st-party-gh-pages-action
Browse files Browse the repository at this point in the history
Use GitHub's `deploy-pages` action to deploy docs
  • Loading branch information
utf authored Aug 14, 2023
2 parents e7e2992 + a59466b commit d8415a5
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@ on:
push:
branches: [main]

# set GITHUB_TOKEN permissions to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

jobs:
build-docs:
if: github.repository_owner == 'materialsproject' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest

steps:
Expand All @@ -31,9 +38,18 @@ jobs:
- name: Build
run: sphinx-build docs docs_build

- name: Deploy
if: github.repository_owner == 'materialsproject' && github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push'
uses: peaceiris/actions-gh-pages@v3
- name: Upload build artifact
uses: actions/upload-pages-artifact@v2
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_dir: ./docs_build/
path: ./docs_build

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build-docs
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

0 comments on commit d8415a5

Please sign in to comment.