-
-
Notifications
You must be signed in to change notification settings - Fork 261
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[skip-pytest]
- Loading branch information
Showing
3 changed files
with
35 additions
and
16 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 |
---|---|---|
@@ -1,12 +1,17 @@ | ||
name: Build Documentation | ||
|
||
|
||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
inputs: | ||
publish: | ||
required: true | ||
type: boolean | ||
pin-tag: | ||
# pin-tag can be used to keep the latest X.Y.Z release tag instead of | ||
# a X.Y.Z-devN tag when updating the docs after a release | ||
required: false | ||
type: string | ||
release: | ||
types: [ released ] | ||
|
||
|
@@ -18,6 +23,7 @@ env: | |
|
||
jobs: | ||
build_docs: | ||
if: (!contains(github.event.head_commit.message, '[skip-doc-build]')) || inputs.publish | ||
name: Build Documentation | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
@@ -58,10 +64,20 @@ jobs: | |
restore-keys: | | ||
fastf1-doc-cache | ||
- name: Install at pinned tag | ||
if: inputs.pin-tag != '' | ||
run: | | ||
git checkout ${{ inputs.fake-tag }} | ||
- name: Install Fast-F1 from sources | ||
run: | | ||
python -m pip install -e . | ||
- name: Re-checkout current commit after install at pinned tag | ||
if: inputs.fake-tag != '' | ||
run: | | ||
git checkout ${{ github.sha }} | ||
- name: Create doc build dir | ||
run: | | ||
mkdir -p docs/_build/html | ||
|
@@ -75,18 +91,28 @@ jobs: | |
- name: Build docs | ||
run: | | ||
mkdir test_cache # not really need but pytest setup relies on it | ||
cd ./docs | ||
make clean | ||
# delete all files in build directory, will be replaced with new | ||
# build (don't use "make clean" as it deletes the .git folder) | ||
# need to go to nested git repository in build directory | ||
cd ./docs/_build/html | ||
git rm -r * | ||
# go back to docs folder in main repository | ||
cd ../.. | ||
make html | ||
- name: Publish docs | ||
if: (github.event_name == 'release') || inputs.publish | ||
- name: Prepare docs for publishing | ||
run: | | ||
cd docs/_build/html | ||
git add . | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
git commit -m "$GITHUB_REF_NAME ($GITHUB_JOB) ci release" | ||
- name: Publish docs | ||
if: (github.event_name == 'release') || inputs.publish | ||
run: | | ||
git push origin gh-pages --force | ||
- name: Upload docs as artifact | ||
|
This file was deleted.
Oops, something went wrong.
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