diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml new file mode 100644 index 000000000..68503c507 --- /dev/null +++ b/.github/workflows/deploy-docs.yml @@ -0,0 +1,64 @@ +name: Build Documentation + +on: + push: + branches: + - develop + release: + types: [published] + + +# disable permissions for all of the available permissions +permissions: {} + + +jobs: + build-docs: + permissions: + contents: write # for mike to push + name: Deploy Docs through mike + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r docs/requirements-docs.txt + + - name: Fetch gh-pages branch + run: | + git fetch origin gh-pages --depth=1 + + - 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: Build and push Mike + if: ${{ github.event_name == 'push' }} + run: | + mike deploy ${{ github.ref_name }} latest --push --update-aliases + + - name: Build and push Mike - Release + if: ${{ github.event_name == 'release' }} + run: | + mike deploy ${{ github.ref_name }} stable --push --update-aliases + + - name: Show mike versions + run: | + mike list + + deploy-to-gha: + needs: build-docs + permissions: + contents: read + pages: write + id-token: write + uses: ./.github/workflows/deploy-to-gha.yml + diff --git a/.github/workflows/deploy-to-gha.yml b/.github/workflows/deploy-to-gha.yml new file mode 100644 index 000000000..8fe77edad --- /dev/null +++ b/.github/workflows/deploy-to-gha.yml @@ -0,0 +1,43 @@ +name: Deploy Documentation + +on: + workflow_dispatch: + workflow_call: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Single deploy job since we're just deploying + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: gh-pages + + - name: Setup Pages + uses: actions/configure-pages@v5 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + # Upload entire repository + path: '.' + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4