Merge pull request #17 from manveru/support-avram-delete-operation #201
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Generate docs | |
on: | |
push: | |
branches: | |
- "main" | |
- "docs" | |
workflow_dispatch: | |
jobs: | |
deploy-docs: | |
runs-on: "ubuntu-latest" | |
name: "Generate docs" | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: docs | |
fetch-depth: 0 # fetch all commits/branches | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.x | |
- uses: actions/cache@v3 | |
name: "Cache Python dependencies (mkdocs-material and mike)" | |
with: | |
# This path is specific to Ubuntu | |
path: ~/.cache/pip | |
# Look to see if there is a cache hit for the corresponding requirements file | |
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
${{ runner.os }}- | |
- name: Install dependencies | |
run: pip install -r requirements.txt | |
- name: Add git user for mike | |
run: | | |
git config --global user.name GitHub Actions | |
git config --global user.email [email protected] | |
- name: "Deploy documentation" | |
run: mike deploy v0.11.0 latest -u --push | |
deploy-api-docs: | |
needs: deploy-docs | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: main | |
- name: Install Crystal | |
uses: crystal-lang/install-crystal@v1 | |
with: | |
crystal: latest | |
- name: Cache Shards | |
uses: actions/cache@v3 | |
with: | |
path: ./lib | |
key: shards-${{ hashFiles('shard.lock') }} | |
- name: Install Shards | |
run: | | |
if ! shards check; then | |
shards install | |
fi | |
- name: Build API docs | |
run: | | |
crystal docs --output=api --project-name=Rosetta \ | |
--canonical-base-url="https://wout.github.io/rosetta/api/latest" --source-url-pattern="https://github.com/wout/rosetta/blob/%{refname}/%{path}#L%{line}" \ | |
--source-refname=${GITHUB_SHA::8} | |
- name: Deploy API docs | |
uses: JamesIves/[email protected] | |
with: | |
branch: gh-pages | |
folder: api | |
target-folder: api/main | |
clean: false |