Skip to content

Commit

Permalink
split docs into workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbc committed Nov 14, 2023
1 parent 23982fe commit d72dd43
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 32 deletions.
86 changes: 86 additions & 0 deletions .github/workflows/publish_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Publish
name: publish workflow

on:
# Triggers the workflow on push events but only for the master branch
push:
branches: [main]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

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

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Setup Pages
id: pages
uses: actions/configure-pages@v3

- name: Install and configure Poetry
uses: GNS-Science/install-poetry@main
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}

#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: |
poetry install --with doc
- name: Build documentation
run: |
poetry run mkdocs build
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./site

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
33 changes: 1 addition & 32 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,6 @@ on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

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

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# Allows you to run this workflow manually from the Actions tab
call-test-workflow:
Expand Down Expand Up @@ -69,24 +56,6 @@ jobs:
virtualenvs-in-project: true
installer-parallel: true

- name: build documentation
run: |
poetry install --with doc
poetry run mkdocs build
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v2
with:
path: ./site

- name: Build wheels and source tarball
run: >-
poetry build
- name: show temporary files
run: >-
ls -l
- name: create github release
id: create_release
uses: GNS-Science/action-gh-release@master
Expand All @@ -103,4 +72,4 @@ jobs:
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
skip_existing: true
skip-existing: true

0 comments on commit d72dd43

Please sign in to comment.