Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

update gh-pages workflow #31

update gh-pages workflow

update gh-pages workflow #31

Workflow file for this run

name: Deploy docs to GitHub Pages
on:
push:
branches: ['main']
tags: ['v**']
workflow_dispatch:
inputs:
set-latest:
type: boolean
required: true
default: false
description: Mark deployed docs as the latest stable release
permissions:
contents: write
concurrency:
group: 'pages'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Generate docs
run: |
npm ci
npm run docs
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs
destination_dir: ${{ github.ref_name }}
user_name: 'GitHub Actions'
user_email: '41898282+github-actions[bot]@users.noreply.github.com'
- name: Deploy for the latest release
if: startsWith(github.ref, 'refs/tags/v') || inputs.set-latest
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs
destination_dir: latest
user_name: 'GitHub Actions'
user_email: '41898282+github-actions[bot]@users.noreply.github.com'