-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
906c8f9
commit f29d87a
Showing
1 changed file
with
21 additions
and
35 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,51 +1,37 @@ | ||
name: doc | ||
|
||
name: Deploy Docs to GitHub Pages | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- patch-workflow | ||
|
||
# Prevent doc action on `main` from conflicting with others. | ||
concurrency: | ||
group: doc-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: write | ||
jobs: | ||
doc: | ||
runs-on: "ubuntu-latest" | ||
timeout-minutes: 30 | ||
|
||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the code | ||
uses: actions/checkout@v4 | ||
|
||
- uses: actions/checkout@v4 | ||
- name: Configure Git Credentials | ||
run: | | ||
git config user.name github-actions[bot] | ||
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | ||
- name: Setup mamba | ||
uses: mamba-org/setup-micromamba@v1 | ||
with: | ||
environment-file: env.yml | ||
environment-name: my_env | ||
cache-environment: true | ||
cache-downloads: true | ||
|
||
- name: Install library | ||
run: python -m pip install --no-deps . | ||
|
||
- name: Configure git | ||
run: | | ||
git config --global user.name "${GITHUB_ACTOR}" | ||
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" | ||
- name: Deploy the doc | ||
run: | | ||
echo "Get the latest version of the doc" | ||
git fetch origin gh-pages | ||
echo "Build and deploy the doc on main" | ||
mike deploy --push patch-workflow | ||
env: | ||
github_token: ${{ secrets.PAT }} | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.x | ||
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV | ||
- uses: actions/cache@v4 | ||
with: | ||
key: mkdocs-material-${{ env.cache_id }} | ||
path: .cache | ||
restore-keys: | | ||
mkdocs-material- | ||
- run: mkdocs gh-deploy --force |