Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ovesh committed Apr 13, 2024
1 parent b439fa8 commit faeb0f3
Showing 1 changed file with 4 additions and 67 deletions.
71 changes: 4 additions & 67 deletions .github/workflows/publish-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@ run-name: build and publish API docs
on:
push:
# only build and publish docs on release-please tags
tags: ["v*"]
paths:
- "docs/**"
- "genome_kit/**"
- ".github/workflows/publish-docs.yaml"
- ".github/actions/**"
branches: ["chore/versionize-docs"]

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
Expand All @@ -22,67 +17,9 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/build-gk
with:
platform: linux-64

- name: restore mamba env
id: restore_mamba_cache
uses: actions/cache/restore@v4
with:
key: mamba-env-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.github/workflows/run-tests.yaml', '.github/actions/**') }}
path: |
~/micromamba
~/.condarc
~/bin/micromamba
fail-on-cache-miss: true

- name: restore the gk package tarballs
id: restore_gk_pkg
uses: actions/cache/restore@v4
with:
key: mamba-env-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.github/workflows/run-tests.yaml', '.github/actions/**', 'conda-recipe/meta.yaml', 'src/**', 'genome_kit/**') }}
path: |
~/conda-bld
fail-on-cache-miss: true

- name: create doc-build env
shell: bash -l -e {0}
run: |
set -x
pkg_name=$(eval ls -1 ~/conda-bld/*/*.tar.bz2 | head -1)
pkg_name=$(basename ${pkg_name})
pkg_version=$(echo $pkg_name | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+')
pkg_name=${pkg_name%%-[0-9]*}
micromamba activate build
conda index ~/conda-bld
mamba create -n doc-build -c file://${HOME}/conda-bld \
${pkg_name}=${pkg_version} \
m2r2 \
make \
myst-parser \
sphinx \
sphinx_rtd_theme
set +x
- name: build docs
- name: try out git stuff
shell: bash -l -e {0}
run: |
set -x
micromamba activate ~/micromamba/envs/build/envs/doc-build
make html -C docs-src
pkg_name=$(eval ls -1 ~/conda-bld/*/*.tar.bz2 | head -1)
pkg_version=$(echo $pkg_name | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+')
mkdir -p ../docs/${pkg_version}/
cp -r docs-src/_build/html/* ../docs/
cp -r docs-src/_build/html/* ../docs/${GK_VERSION}/
set +x
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: docs/_build/html
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
git checkout gh-pages
git ls-files

0 comments on commit faeb0f3

Please sign in to comment.