-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add
mike
to the documentation and update looks (#809)
- Loading branch information
1 parent
5487b6b
commit 50766b1
Showing
5 changed files
with
751 additions
and
204 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 |
---|---|---|
|
@@ -5,29 +5,33 @@ on: | |
branches: | ||
- main | ||
paths: | ||
- 'docs/**' | ||
- 'mkdocs.yml' | ||
- "docs/**" | ||
- "mkdocs.yml" | ||
tags: | ||
- v** | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- 'docs/**' | ||
- 'install/**' | ||
- '.github/workflows/docs.yml' | ||
- 'mkdocs.yml' | ||
- 'pixi.*' | ||
- "docs/**" | ||
- ".github/workflows/docs.yml" | ||
- "mkdocs.yml" | ||
- "pixi.*" | ||
workflow_dispatch: | ||
|
||
inputs: | ||
tag: | ||
description: "Tag to deploy" | ||
required: true | ||
default: "v0.0.0" | ||
|
||
# Allow one concurrent deployment | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
# Don't run on forks | ||
if: github.repository == 'prefix-dev/pixi' | ||
build-docs: | ||
if: github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/v') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
|
@@ -40,37 +44,72 @@ jobs: | |
pixi-version: v0.13.0 | ||
cache: true | ||
|
||
- name: Setup Pages | ||
uses: actions/configure-pages@v4 | ||
- name: Build docs for test | ||
run: | | ||
pixi run build-docs | ||
- name: Build pixi Documentation | ||
run: pixi run build-docs | ||
docs-release: | ||
# Don't run on forks | ||
if: startsWith(github.event.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.tag, 'v') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
# fetch everything so we can checkout the tag | ||
fetch-depth: 0 | ||
submodules: recursive | ||
|
||
# This adds the following: | ||
# - A .nojekyll file to disable Jekyll GitHub Pages builds. | ||
# - Adds installation scripts to the pages webserver. | ||
- name: Finalize documentation | ||
# check out tag if workflow_dispatch | ||
- name: Checkout tag | ||
if: github.event_name == 'workflow_dispatch' | ||
run: | | ||
touch site/.nojekyll | ||
cp install/{install.sh,install.ps1} site | ||
# https://github.com/actions/upload-pages-artifact#file-permissions | ||
- run: chmod -c -R +rX site/ | ||
git checkout tags/${{ github.event.inputs.tag }} | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
- uses: prefix-dev/[email protected] | ||
with: | ||
path: "site" | ||
pixi-version: v0.13.0 | ||
cache: true | ||
|
||
- name: Configure Git user | ||
run: | | ||
git config --local user.email "github-actions[bot]@users.noreply.github.com" | ||
git config --local user.name "github-actions[bot]" | ||
- name: Extract tag name | ||
if: github.event_name != 'workflow_dispatch' | ||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
|
||
deploy: | ||
- name: Tag from workflow_dispatch | ||
if: github.event_name == 'workflow_dispatch' | ||
run: echo "RELEASE_VERSION=${{ github.event.inputs.tag }}" >> $GITHUB_ENV | ||
|
||
- name: Deploy with mike 🚀 | ||
run: | | ||
pixi run mike deploy --push --update-aliases $RELEASE_VERSION latest | ||
docs-dev: | ||
# Don't run on forks | ||
if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' && !startsWith(github.event.inputs.tag, 'v') | ||
runs-on: ubuntu-latest | ||
needs: build | ||
if: github.repository == 'prefix-dev/pixi' && github.ref == 'refs/heads/main' | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
# fetch everything so we can checkout the tag | ||
fetch-depth: 0 | ||
submodules: recursive | ||
|
||
- uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.13.0 | ||
cache: true | ||
|
||
- name: Configure Git user | ||
run: | | ||
git config --local user.email "github-actions[bot]@users.noreply.github.com" | ||
git config --local user.name "github-actions[bot]" | ||
- name: Deploy with mike 🚀 | ||
run: | | ||
pixi run deploy-dev |
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
Oops, something went wrong.