Update packaging to latest PyPA recommendations #150
Workflow file for this run
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
name: Publish Documentation | |
on: | |
# comment here for production use | |
# push | |
# comment here for development use | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: # allow manual triggering | |
inputs: | |
deploy: | |
description: 'Deploy documentation' | |
type: boolean | |
required: true | |
default: false | |
jobs: | |
docs: | |
if: github.repository_owner == 'bluesky' | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.9] | |
steps: | |
- name: get correct package name from repository | |
shell: bash -l {0} | |
run: | | |
echo "PACKAGE=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV | |
- name: show that | |
shell: bash -l {0} | |
run: | | |
env | sort | grep hklpy | |
- uses: actions/checkout@v4 | |
- name: Deploy Information | |
if: ${{ github.event.inputs.deploy }} | |
run: | | |
echo "The docs will be published from this workflow run." | |
- name: Install Python ${{ matrix.python-version }} Conda environment with micromamba from env-dev.yml | |
uses: mamba-org/provision-with-micromamba@main | |
with: | |
environment-file: env-dev.yml | |
environment-name: test | |
- name: Install the package locally | |
shell: bash -l {0} | |
run: | | |
pip install -e . | |
- name: Diagnostics | |
shell: bash -l {0} | |
run: | | |
conda info | |
conda list | |
env | sort | grep -i CONDA | |
- name: Build Docs | |
shell: bash -l {0} | |
run: | | |
make -C docs clean html | |
# comment here for development use | |
- name: Deploy documentation to blueskyproject.io. | |
# We pin to the SHA, not the tag, for security reasons. | |
# https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions | |
uses: peaceiris/actions-gh-pages@bbdfb200618d235585ad98e965f4aafc39b4c501 # v3.7.3 | |
if: ${{ github.event.inputs.deploy }} | |
with: | |
deploy_key: ${{ secrets.ACTIONS_DOCUMENTATION_DEPLOY_KEY }} | |
publish_branch: master | |
publish_dir: ./docs/build/html | |
external_repository: bluesky/bluesky.github.io | |
destination_dir: ${{ env.PACKAGE }} | |
keep_files: true # Keep old files. | |
force_orphan: false # Keep git history. |