Deploy Documentation #39
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: Deploy Documentation | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| use-main-as-release: | |
| description: "Render release site from main instead of latest tag" | |
| type: boolean | |
| default: false | |
| release: | |
| types: | |
| - published | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| env: | |
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
| GH_TOKEN: ${{ github.token }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Quarto CLI | |
| uses: quarto-dev/quarto-actions/setup@v2 | |
| with: | |
| version: pre-release | |
| - name: Get latest tag | |
| if: inputs.use-main-as-release != true | |
| id: latest-tag | |
| shell: bash | |
| run: | | |
| LATEST_TAG=$(git tag -l --sort=-v:refname '[0-9]*' | head -n 1) | |
| if [ -z "${LATEST_TAG}" ]; then | |
| echo "::error::No version tags found" | |
| exit 1 | |
| fi | |
| echo "tag=${LATEST_TAG}" >> "${GITHUB_OUTPUT}" | |
| echo "Latest tag: ${LATEST_TAG}" | |
| - name: Checkout latest tag | |
| if: inputs.use-main-as-release != true | |
| shell: bash | |
| env: | |
| LATEST_TAG: ${{ steps.latest-tag.outputs.tag }} | |
| run: git checkout "${LATEST_TAG}" | |
| - name: Render release site | |
| shell: bash | |
| working-directory: ./docs | |
| run: quarto render . | |
| - name: Checkout default branch | |
| shell: bash | |
| env: | |
| DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} | |
| run: git checkout "${DEFAULT_BRANCH}" | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v6 | |
| - name: Install dependencies | |
| shell: bash | |
| run: npm ci | |
| - name: Generate API docs | |
| shell: bash | |
| run: npm run docs:api | |
| - name: Build dev VSIX | |
| shell: bash | |
| run: npx vsce package --pre-release --out docs/quarto-wizard-dev.vsix | |
| - name: Render dev site | |
| shell: bash | |
| working-directory: ./docs | |
| run: quarto render . --profile dev | |
| - name: Prepare site for deployment | |
| shell: bash | |
| run: touch docs/_site/.nojekyll | |
| - name: Configure GitHub Pages | |
| uses: actions/configure-pages@v6 | |
| - name: Upload Pages Artifact | |
| uses: actions/upload-pages-artifact@v5 | |
| with: | |
| path: "./docs/_site" | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v5 |