-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: decouple docs release and introduce versioning (#1752)
* fix: decouple docs Signed-off-by: Chris Butler <[email protected]> * feat: add support for mike Signed-off-by: Chris Butler <[email protected]> --------- Signed-off-by: Chris Butler <[email protected]>
- Loading branch information
Showing
5 changed files
with
86 additions
and
36 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 |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
name: Trestle Docs update | ||
on: | ||
push: | ||
branches: | ||
- develop | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
set-versions: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
min: ${{ steps.versions.outputs.min }} | ||
max: ${{ steps.versions.outputs.max }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- id: versions | ||
run: | | ||
min_version=$(jq '.PYTHON_MIN' -r version.json) | ||
max_version=$(jq '.PYTHON_MAX' -r version.json) | ||
echo "min=$min_version" | ||
echo "max=$max_version" | ||
echo "min=$min_version" >> $GITHUB_OUTPUT | ||
echo "max=$max_version" >> $GITHUB_OUTPUT | ||
mike-version: | ||
runs-on: ubuntu-latest | ||
needs: [ set-versions] | ||
outputs: | ||
mver: ${{ steps.versions.mver }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ needs.set-versions.outputs.max }} | ||
uses: actions/setup-python@v5 | ||
# This is deliberately not using a custom credential as it relies on native github actions token to have push rights. | ||
with: | ||
python-version: ${{ needs.set-versions.outputs.max }} | ||
- id: versions | ||
run: | | ||
mike_version=$(python ./scripts/check-version.py ${{ env.GITHUB_REF }}) | ||
echo "mver=$mike_version" >> $GITHUB_OUTPUT | ||
deploy-docs: | ||
runs-on: ubuntu-latest | ||
needs: [ mike-version ] | ||
steps: | ||
- uses: actions/create-github-app-token@v1 | ||
id: app-token | ||
with: | ||
app-id: ${{ secrets.APP_ID }} | ||
private-key: ${{ secrets.PRIVATE_KEY }} | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
fetch-depth: 0 | ||
token: ${{ steps.app-token.outputs.token }} | ||
- name: Set up Python ${{ needs.set-versions.outputs.max }} | ||
uses: actions/setup-python@v5 | ||
# This is deliberately not using a custom credential as it relies on native github actions token to have push rights. | ||
with: | ||
python-version: ${{ needs.set-versions.outputs.max }} | ||
- name: Install build tools | ||
run: | | ||
make develop | ||
- name: Install documenation dependencies | ||
run: | | ||
make docs-ubuntu-deps | ||
- name: Create release | ||
shell: bash | ||
run: | | ||
mike deploy ${{ needs.mike-version.outputs.mver }} | ||
- name: Ensure latest is latest | ||
shell: bash | ||
run: | | ||
mike set-default latest |
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
Empty file.
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
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