fix: use correct python version #203
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@v4 | |
with: | |
ref: docs | |
fetch-depth: 0 # fetch all commits/branches | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- 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 actions@github.com | |
- 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/github-pages-deploy-action@4.1.4 | |
with: | |
branch: gh-pages | |
folder: api | |
target-folder: api/main | |
clean: false |