Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/previews #2234

Merged
merged 6 commits into from
May 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Build
description: Setup to run and run mkdocs
runs:
using: "composite"
steps:
- name: Setup build environment
uses: actions/setup-python@v4
with:
python-version: '3.x'
cache: 'pip'
- name: Install build requirements
shell: bash
run: pip install -r requirements.txt
- name: Build docs
shell: bash
run: mkdocs build
27 changes: 27 additions & 0 deletions .github/workflows/docs-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: "Build docs preview"
on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed
concurrency: preview-${{ github.ref }}
permissions:
# Needed to update the preview branch.
contents: write
# Needed to write/maintain the comment
pull-requests: write
jobs:
preview:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build docs
uses: ./.github/actions/build
- name: Deploy docs preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: site
17 changes: 8 additions & 9 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: write
jobs:
Expand All @@ -13,12 +12,12 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup build environment
uses: actions/setup-python@v4
- name: Build docs
uses: ./.github/actions/build
- name: Deploy docs
uses: JamesIves/github-pages-deploy-action@v4
with:
python-version: '3.x'
cache: 'pip'
- name: Install build requirements
run: pip install -r requirements.txt
- name: Build and deploy docs
run: mkdocs gh-deploy --force
folder: site
force: false
clean-exclude: |
pr-preview