add general settings, update site #2307
This file contains hidden or 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: docs_pages_workflow | |
| on: | |
| push: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| concurrency: | |
| group: docs-build-${{ github.ref_name }} | |
| cancel-in-progress: true | |
| steps: | |
| - name: Checkout docs repo at triggering branch | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Build only this branch (tooling action) | |
| uses: netrisai/docs-tooling@v1.1.2 | |
| with: | |
| mode: build-only | |
| repo: ${{ github.repository }} | |
| ref_name: ${{ github.ref_name }} | |
| sha: ${{ github.sha }} | |
| - name: Upload build artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: html-${{ github.ref_name }}-${{ github.sha }} | |
| path: _build/html | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| concurrency: | |
| group: docs-deploy | |
| cancel-in-progress: false | |
| steps: | |
| - name: Checkout docs repo (for gh-pages push) | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Skip deploy if stale (branch advanced) | |
| run: | | |
| set -euo pipefail | |
| git fetch origin "${{ github.ref_name }}" --depth=1 | |
| LATEST_SHA="$(git rev-parse FETCH_HEAD)" | |
| if [[ "${LATEST_SHA}" != "${{ github.sha }}" ]]; then | |
| echo "INFO: Skipping deploy. Run SHA=${{ github.sha }}, but branch is now at ${LATEST_SHA}." | |
| exit 0 | |
| fi | |
| - name: Download build artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: html-${{ github.ref_name }}-${{ github.sha }} | |
| path: _build/html | |
| - name: Deploy subtree for this branch (+ latest if applicable) | |
| uses: netrisai/docs-tooling@v1.1.2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| mode: deploy-only | |
| repo: ${{ github.repository }} | |
| ref_name: ${{ github.ref_name }} | |
| sha: ${{ github.sha }} |