-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (48 loc) · 1.71 KB
/
build-docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: build docs
on:
push:
branches:
- main
- dev
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # fetch all commits/branches
- uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Fetch current date
id: date
run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_OUTPUT
- name: Read pipeline version from .nf-core.yml
uses: nichmor/[email protected]
id: read_yml
with:
config: ${{ github.workspace }}/.nf-core.yml
- name: Parse version
id: version
run: |
[[ ${{ steps.read_yml.outputs['template.version'] }} == *"dev"* ]] && pipeline_version="dev" || pipeline_version=${{ steps.read_yml.outputs['template.version'] }}
echo "version=$pipeline_version" >> $GITHUB_OUTPUT
- name: Setup git user
run: |
git config --global user.name "${{github.actor}}"
git config --global user.email "${{github.actor}}@users.noreply.github.com"
- uses: actions/cache@v3
with:
key: mkdocs-material-${{ steps.date.outputs.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- name: Install dependencies
run: pip install mkdocs-material pymdown-extensions pillow cairosvg mike
- name: Build docs
run: |
[[ ${{ steps.version.outputs.version }} == "dev" ]] && mike deploy --push ${{ steps.version.outputs.version }} || mike deploy --push --update-aliases ${{ env.pipeline_version }} latest
- name: Set default docs
run: mike set-default --push latest