Add Woodpecker CI setup guide for Gitea integration #22
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
| # DO NOT EDIT - This file is generated by cigen | |
| # Source: .cigen/workflows/ | |
| # Regenerate with: cargo run -- --config .cigen generate | |
| # | |
| name: DOCS | |
| on: | |
| pull_request: {} | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: rust:latest | |
| needs: | |
| - ci_gate | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Compute source hash | |
| id: compute_hash | |
| run: | | |
| set -euo pipefail | |
| mkdir -p .cigen/skip-cache | |
| mkdir -p .cigen/cache | |
| ./.cigen/bin/cigen hash \ | |
| --job build \ | |
| --config .cigen \ | |
| --base-dir . \ | |
| --output job_hash \ | |
| --cache .cigen/cache/file-hashes.json | |
| - name: Restore skip cache | |
| id: job_skip_cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: .cigen/skip-cache/build | |
| key: job-skip-${ runner.os }-build-${ steps.compute_hash.outputs.job_hash } | |
| restore-keys: job-skip-${ runner.os }-build- | |
| if: ${{ env.ACT != 'true' }} | |
| - name: Skip job (cached) | |
| if: steps.job_skip_cache.outputs.cache-hit == 'true' | |
| run: echo 'Job cache hit; skipping remaining steps.' && exit 0 | |
| - name: Prepare Node runtime for actions | |
| if: (env.ACT == 'true') && (steps.job_skip_cache.outputs.cache-hit != 'true') | |
| run: | | |
| set -e | |
| if ! command -v node >/dev/null 2>&1 || ! command -v protoc >/dev/null 2>&1; then | |
| apt-get update | |
| apt-get install -y nodejs npm protobuf-compiler | |
| fi | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| if: steps.job_skip_cache.outputs.cache-hit != 'true' | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| if: steps.job_skip_cache.outputs.cache-hit != 'true' | |
| - name: Install root deps (if any) | |
| run: | | |
| pnpm install --frozen-lockfile || pnpm install | |
| if: steps.job_skip_cache.outputs.cache-hit != 'true' | |
| - name: Build docs (if present) | |
| run: | | |
| set -e | |
| if [ -f docs/package.json ]; then | |
| cd docs | |
| pnpm install --frozen-lockfile || pnpm install | |
| if pnpm run -s build; then | |
| echo "Docs built with pnpm" | |
| elif npm run build; then | |
| echo "Docs built with npm" | |
| else | |
| echo "Docs build script not found" >&2 | |
| exit 1 | |
| fi | |
| if [ ! -d dist ]; then | |
| echo "Docs build output not found at dist/" >&2 | |
| exit 1 | |
| fi | |
| else | |
| echo "docs/package.json not found; docs site missing" >&2 | |
| exit 1 | |
| fi | |
| if: steps.job_skip_cache.outputs.cache-hit != 'true' | |
| - name: Verify docs output exists | |
| run: | | |
| if [ ! -d docs/dist ]; then | |
| echo "Docs build output not found at docs/dist" >&2 | |
| exit 1 | |
| fi | |
| if: steps.job_skip_cache.outputs.cache-hit != 'true' | |
| - uses: actions/configure-pages@v5 | |
| if: steps.job_skip_cache.outputs.cache-hit != 'true' | |
| - uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: docs/dist | |
| if: steps.job_skip_cache.outputs.cache-hit != 'true' | |
| - name: Record job completion | |
| if: success() && steps.job_skip_cache.outputs.cache-hit != 'true' | |
| run: | | |
| set -e | |
| HASH="${JOB_HASH}" | |
| if [ -z "$HASH" ]; then | |
| echo 'JOB_HASH missing' >&2 | |
| exit 1 | |
| fi | |
| MARKER=.cigen/skip-cache/build/$HASH | |
| mkdir -p "$(dirname "$MARKER")" | |
| date > "$MARKER" | |
| env: | |
| JOB_HASH: ${{ steps.compute_hash.outputs.job_hash }} | |
| ci_gate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Prepare Node runtime for actions | |
| if: ${{ env.ACT == 'true' }} | |
| run: | | |
| set -e | |
| if ! command -v node >/dev/null 2>&1 || ! command -v protoc >/dev/null 2>&1; then | |
| apt-get update | |
| apt-get install -y nodejs npm protobuf-compiler | |
| fi | |
| - uses: actions/github-script@v7 | |
| with: | |
| script: |- | |
| const wait = require('./.github/wait-for-checks.js'); | |
| await wait({ github, context, core, checks: ["test"] }); | |
| deploy: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build | |
| env: | |
| url: https://docspring.github.io/cigen/ | |
| name: github-pages | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Prepare Node runtime for actions | |
| if: ${{ env.ACT == 'true' }} | |
| run: | | |
| set -e | |
| if ! command -v node >/dev/null 2>&1 || ! command -v protoc >/dev/null 2>&1; then | |
| apt-get update | |
| apt-get install -y nodejs npm protobuf-compiler | |
| fi | |
| - uses: actions/deploy-pages@v4 |