Skip to content

Commit

Permalink
Action for autopublishing docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sujaypatil96 committed Aug 24, 2022
1 parent e8a4f4b commit fe5feb8
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 34 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/build-publish-documentation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Build and deploy documentation

# Controls when the action will run. Triggers the workflow on PR to main
on:
push:
branches:
- main
paths:
- "mkdocs.yml"
- "linkml_model/model/schema/*.yaml"
- "linkml_model/model/docs/*"

jobs:
github-pages:
runs-on: ubuntu-latest

steps:
#----------------------------------------------
# check-out repo and set-up python
#----------------------------------------------
- name: Check out repository
uses: actions/checkout@v2

- name: Setup Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9

#----------------------------------------------
# install & configure poetry
#----------------------------------------------
- name: Install Poetry
uses: snok/[email protected]
with:
virtualenvs-create: true
virtualenvs-in-project: true

#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ runner.os }}-${{ 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 --no-interaction --no-root

#----------------------------------------------
# generate markdown files
#----------------------------------------------
- run: make gendoc

#----------------------------------------------
# deploy documentation
#----------------------------------------------
- run: make deploy

2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# https://docs.github.com/en/actions/guides/building-and-testing-python
# https://github.com/snok/install-poetry#workflows-and-tips

name: Build and test linkml-runtime
name: Build and test linkml-model

on: [pull_request]

Expand Down
32 changes: 0 additions & 32 deletions .github/workflows/pr-test.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/pypi-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set up Python
uses: actions/[email protected]
with:
python-version: 3.8
python-version: 3.9

- name: Install Poetry
uses: snok/[email protected]
Expand Down

0 comments on commit fe5feb8

Please sign in to comment.