Skip to content

release(v1.2.2): prepare (#121) #186

release(v1.2.2): prepare (#121)

release(v1.2.2): prepare (#121) #186

Workflow file for this run

name: Deploy Docs
on:
push:
branches:
- master
- docs/* # Useful for testing changes to docs
tags:
- 'v*.*.*' # Trigger on version tags like v1.0.0, v2.1.3, etc.
- 'v*'
- 'latest'
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: 'pages'
cancel-in-progress: false
defaults:
run:
shell: bash
jobs:
build:
name: Build Docs for ${{ matrix.version }}
runs-on: ubuntu-latest
strategy:
matrix:
version:
- v1
- latest
- ${{ github.ref_name }}
steps:
- name: Checkout ${{ matrix.version }}
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
with:
ref: ${{ matrix.version }}
- name: Get formatted ref name
id: formatted-ref-name
run: echo "formatted_ref_name=${{ matrix.version }}" | sed 's/\//_/g' >> $GITHUB_OUTPUT
- uses: pnpm/action-setup@08c4be7e2e672a47d11bd04269e27e5f3e8529cb # v6
with:
run_install: true
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6
with:
node-version: '24'
cache: 'pnpm'
- name: Setup Pages
id: pages
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6
- name: Compile TypeScript
run: pnpm compile
- name: Build docs
run: pnpm docs:gen ${{ steps.formatted-ref-name.outputs.formatted_ref_name }}
- name: Copy latest to root
if: matrix.version == 'latest'
run: cp -r docs-html/latest/* docs-html/
- name: Upload artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: docs-${{ steps.formatted-ref-name.outputs.formatted_ref_name }}
path: ./docs-html
retention-days: 1
- name: Where to find the docs
run: echo "You can find the documentation for version ${{ matrix.version }} at https://jacobshirley.github.io/pki-lite/${{ steps.formatted-ref-name.outputs.formatted_ref_name }}" >> $GITHUB_STEP_SUMMARY
combine:
name: Combine Docs
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
merge-multiple: true
path: ./docs-html
- name: Upload combined artifact
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5
with:
path: ./docs-html
retention-days: 1
name: 'github-pages'
deploy:
name: Deploy
runs-on: ubuntu-latest
needs: combine
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5