-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updating version switcher and cleaning docs with github-deploy-action…
… instead of checking out and doing it manually, testing
- Loading branch information
Showing
1 changed file
with
8 additions
and
30 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,47 +66,25 @@ jobs: | |
- name: remove jekyll theming | ||
run: touch docs/build/.nojekyll | ||
|
||
- name: save changes and checkout to gh-pages | ||
run: | | ||
git add -f . | ||
git stash | ||
git checkout gh-pages | ||
git pull origin gh-pages | ||
- name: clean outdated documentation | ||
uses: EndBug/[email protected] | ||
with: | ||
remove: '-r --ignore-unmatch ${{ env.DOC_VERSION }}' | ||
|
||
- name: checkout to original branch and reapply changes | ||
run: | | ||
git checkout - | ||
git stash pop | ||
- name: deploy website | ||
# TODO: Make a better True-False flag for deploying for Pull Requests. If at all? | ||
# Make this use GitHub Action Variables. | ||
# (PR only) Changed the variable below to False if you don't want to build docs for your PR | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
branch: gh-pages | ||
folder: docs/build/ | ||
target-folder: ${{ env.DOC_VERSION }} | ||
clean: False | ||
clean: True | ||
|
||
- name: checkout to gh-pages (tags only) (remove master before merging PR) | ||
- name: copy version switcher for updating it | ||
if: ${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master' }} | ||
run: | | ||
git stash | ||
git checkout gh-pages | ||
git pull origin gh-pages | ||
cp ${{ env.DOC_VERSION }}/_static/switcher.json ./switcher.json | ||
run: cp docs/build/_static/switcher.json docs/build/switcher/switcher.json | ||
|
||
- name: update version switcher file (tags only) (remove master before merging PR) | ||
- name: update version switcher | ||
if: ${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master' }} | ||
uses: EndBug/[email protected] | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
add: './switcher.json --force' | ||
branch: gh-pages | ||
folder: docs/build/switcher/ | ||
clean: False | ||
|
||
- name: print link to the documentation | ||
run: | | ||
|