Merge pull request #4 from fmaguire/patch-1 #176
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: Publish Docs On Change | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ main, master] | |
jobs: | |
build: | |
name: Deploy docs | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: Checkout main | |
uses: actions/checkout@v2 | |
- name: Pull Bactopia | |
uses: actions/checkout@v2 | |
with: | |
repository: bactopia/bactopia | |
path: bactopia | |
- name: Setup miniconda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
activate-environment: bactopia | |
auto-activate-base: false | |
- name: Setup Docs Environment | |
env: | |
MKDOCS_INSIDERS: ${{ secrets.MKDOCS_INSIDERS }} | |
run: | | |
# Conda dependencies | |
conda install -c conda-forge -c bioconda nextflow jinja2 jq pyyaml 'python>3.6' | |
# MkDocs dependencies | |
pip install \ | |
"cairosvg>=2.5" \ | |
"mkdocs-git-committers-plugin-2<1" \ | |
"mkdocs-git-revision-date-localized-plugin>=1.0" \ | |
"mkdocs-minify-plugin>=0.3" \ | |
"mkdocs-rss-plugin>=1.1" \ | |
"mkdocs-redirects>=1.0" \ | |
"pillow<10" \ | |
mike | |
# MkDocs Insiders | |
pip install \ | |
git+https://${MKDOCS_INSIDERS}@github.com/rpetit3/mkdocs-material-insiders.git | |
mkdocs --version | |
- name: Convert Bactopia to Docs | |
run: | | |
nextflow config -flat $GITHUB_WORKSPACE/bactopia/main.nf > $GITHUB_WORKSPACE/bactopia/nextflow_config.txt | |
python3 $GITHUB_WORKSPACE/bin/bactopia-to-md.py $GITHUB_WORKSPACE/bactopia $GITHUB_WORKSPACE | |
cp -f $GITHUB_WORKSPACE/bactopia/CHANGELOG.md $GITHUB_WORKSPACE/docs/changelog.md | |
rm -rf $GITHUB_WORKSPACE/bactopia | |
- name: Deploy Docs | |
run: | | |
git fetch origin gh-pages --depth=1 | |
git config user.name "GitHub Actions" | |
git config user.email [email protected] | |
LATEST_RELEASE=$(curl -sL https://api.github.com/repos/bactopia/bactopia/releases/latest | jq -r ".tag_name") | |
mike deploy --config-file mkdocs.insiders.yml --update-aliases ${LATEST_RELEASE} latest | |
mike set-default --push latest | |
- name: Commit changes | |
uses: EndBug/add-and-commit@v7 | |
with: | |
message: "ci - auto build from bactopia" | |
committer_name: GitHub Actions | |
committer_email: [email protected] | |
add: 'mkdocs.yml docs/' |