Publish Documentation and Example Website #606
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: Publish Documentation and Example Website | |
on: | |
workflow_run: | |
workflows: | |
- CI | |
- Release Please | |
types: | |
- completed | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: pages | |
cancel-in-progress: false | |
jobs: | |
publish: | |
name: Publish Documentation and Example Website | |
runs-on: ubuntu-latest | |
if: github.event.workflow_run.conclusion == 'success' | |
environment: | |
name: github-pages | |
url: ${{ steps.deploy.outputs.page_url }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v5 | |
- name: Set up GitHub Pages | |
uses: actions/configure-pages@v5 | |
- name: Set up pnpm | |
uses: pnpm/action-setup@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v5 | |
with: | |
node-version: latest | |
cache: pnpm | |
- name: Install dependencies | |
run: pnpm install | |
- name: Build workspace packages and documentation | |
run: | | |
pnpm build | |
pnpm build:docs | |
- name: Prepare structure | |
run: | | |
mkdir -p github-pages/docs | |
cp -r packages/catppuccin-unocss/docs/* github-pages/docs/ | |
cp -r example/dist/* github-pages/ | |
- name: Upload artifacts | |
uses: actions/upload-pages-artifact@v4 | |
with: | |
path: github-pages | |
- name: Deploy to GitHub Pages | |
id: deploy | |
uses: actions/deploy-pages@v4 | |
with: | |
preview: ${{ github.event.workflow_run.event == 'CI' }} |