continuwuity/.forgejo/workflows/documentation.yml
Renovate Bot a5af7b39bd
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m33s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m18s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m53s
Deploy Element Web / 🏗️ Build and Deploy (pull_request) Successful in 7m36s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 8m26s
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 8s
Mirror Container Images / mirror-images (push) Successful in 49s
Checks / Prek / Pre-commit & Formatting (push) Successful in 1m16s
Documentation / Build and Deploy Documentation (push) Successful in 1m27s
Deploy Element Web / 🏗️ Build and Deploy (push) Successful in 8m19s
Checks / Prek / Clippy and Cargo Tests (push) Successful in 9m0s
Maintenance / Renovate / Renovate (push) Successful in 2m58s
Release Docker Image / Build linux-amd64 (release) (push) Successful in 12m20s
Release Docker Image / Build linux-arm64 (release) (push) Successful in 16m2s
Release Docker Image / Create Multi-arch Release Manifest (push) Successful in 39s
Release Docker Image / Build linux-arm64 (max-perf) (push) Has been cancelled
Release Docker Image / Build linux-amd64 (max-perf) (push) Has been cancelled
Release Docker Image / Create Max-Perf Manifest (push) Has been cancelled
chore(deps): pin dependencies
2026-04-13 05:22:53 +00:00

71 lines
2.7 KiB
YAML

name: Documentation
on:
pull_request:
push:
branches:
- main
tags:
- "v*"
workflow_dispatch:
concurrency:
group: "pages-${{ github.ref }}"
cancel-in-progress: true
jobs:
docs:
name: Build and Deploy Documentation
runs-on: ubuntu-latest
if: secrets.CLOUDFLARE_API_TOKEN != ''
steps:
- name: Sync repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
fetch-depth: 0
- name: Detect runner environment
id: runner-env
uses: https://git.tomfos.tr/actions/detect-versions@v1
- name: Setup Node.js
if: steps.runner-env.outputs.node_major == '' || steps.runner-env.outputs.node_major < '20'
uses: https://github.com/actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version: 22
- name: Cache npm dependencies
uses: actions/cache@6f8efc29b200d32929f49075959781ed54ec270c # v3
with:
path: ~/.npm
key: continuwuity-rspress-${{ steps.runner-env.outputs.slug }}-${{ steps.runner-env.outputs.arch }}-node-${{ steps.runner-env.outputs.node_version }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
continuwuity-rspress-${{ steps.runner-env.outputs.slug }}-${{ steps.runner-env.outputs.arch }}-node-${{ steps.runner-env.outputs.node_version }}-
continuwuity-rspress-${{ steps.runner-env.outputs.slug }}-${{ steps.runner-env.outputs.arch }}-node-
- name: Install dependencies
run: npm ci
- name: Build Rspress documentation
run: npm run docs:build
- name: Install Wrangler
run: npm install --save-dev wrangler@latest
- name: Deploy to Cloudflare Pages (Production)
if: github.ref == 'refs/heads/main' && vars.CLOUDFLARE_PROJECT_NAME != ''
uses: https://github.com/cloudflare/wrangler-action@da0e0dfe58b7a431659754fdf3f186c529afbe65 # v3
with:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
command: pages deploy ./doc_build --branch="main" --commit-dirty=true --project-name="${{ vars.CLOUDFLARE_PROJECT_NAME }}"
- name: Deploy to Cloudflare Pages (Preview)
if: github.ref != 'refs/heads/main' && vars.CLOUDFLARE_PROJECT_NAME != ''
uses: https://github.com/cloudflare/wrangler-action@da0e0dfe58b7a431659754fdf3f186c529afbe65 # v3
with:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
command: pages deploy ./doc_build --branch="${{ github.head_ref || github.ref_name }}" --commit-dirty=true --project-name="${{ vars.CLOUDFLARE_PROJECT_NAME }}"