Skip to content

docs: enhance GitHub Actions workflow for documentation deployment #4

docs: enhance GitHub Actions workflow for documentation deployment

docs: enhance GitHub Actions workflow for documentation deployment #4

Workflow file for this run

name: Docs
on:
pull_request:
paths:
- 'docs/**'
- '.github/workflows/docs.yml'
- 'package/**'
- 'README.md'
push:
branches:
- main
paths:
- 'docs/**'
- '.github/workflows/docs.yml'
- 'package/**'
- 'README.md'
tags:
- '*'
jobs:
build:
name: Build docs
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install
- name: Build docs
run: bun run docs:build
- name: Upload build
uses: actions/upload-pages-artifact@v3
with:
path: docs/build
deploy:
name: Deploy to GitHub Pages
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deploy.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deploy
uses: actions/deploy-pages@v4