Skip to content

Commit 9d38ec9

Browse files
committed
stable and latest docs
1 parent 9772ec1 commit 9d38ec9

1 file changed

Lines changed: 18 additions & 3 deletions

File tree

.github/workflows/docs.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010

1111
jobs:
1212
tests:
13-
name: "Tests"
13+
name: "Docs"
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v2
@@ -30,10 +30,25 @@ jobs:
3030
with:
3131
name: docs-html
3232
path: docs/_build/html/
33-
- name: publish docs
34-
if: github.ref_name == 'main' && github.ref_type == 'branch'
33+
- name: publish dev docs
34+
if: github.ref_name == 'docs-switch' && github.ref_type == 'branch'
3535
uses: peaceiris/actions-gh-pages@v3
3636
with:
3737
github_token: ${{ secrets.GITHUB_TOKEN }}
3838
publish_dir: docs/_build/*
3939
publish_branch: gh-pages
40+
destination_dir: main
41+
- name: publish stable docs
42+
if: github.ref_name == 'main' && github.ref_type == 'tag' && startswith(github.ref, 'refs/tags/v')
43+
uses: peaceiris/actions-gh-pages@v3
44+
with:
45+
github_token: ${{ secrets.GITHUB_TOKEN }}
46+
publish_dir: docs/_build/*
47+
publish_branch: gh-pages
48+
destination_dir: github.ref_name
49+
- name: create symlink stable to new version
50+
if: github.ref_name == 'main' && github.ref_type == 'tag' && startswith(github.ref, 'refs/tags/v')
51+
run: |
52+
rm stable
53+
ln -s "${{ github.ref_name }}" stable
54+
ls -la

0 commit comments

Comments
 (0)