mirror of
https://gitea.com/gitea/docs.git
synced 2026-11-15 14:23:44 +00:00
The v28 release (#564) added the `prepare-awesome-v%` Makefile rule, but the checks and publish workflows still only prepare awesome.md up to 1.27, so version-28/awesome.md is not generated in CI. Both workflows now call `prepare-awesome-v28`. The preview step is skipped when Cloudflare secrets are unavailable, which is the case for pull requests from forks (#557 and #565 have no preview line, while same-repo PRs like #533 and #563 do). The skip is now a visible notice. Previewing fork PRs would need a separate trusted workflow and is not part of this change. Reviewed-on: https://gitea.com/gitea/docs/pulls/579 Reviewed-by: bircni <[email protected]> Co-authored-by: Lunny Xiao <[email protected]>
49 lines
1.9 KiB
YAML
49 lines
1.9 KiB
YAML
name: Build and Publish Docs site
|
|
run-name: astro build docs site
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build-docs:
|
|
runs-on: ubuntu-24.04
|
|
env:
|
|
NODE_OPTIONS: --max-old-space-size=8192
|
|
# search only appears once the credentials are set, the build falls back
|
|
# to pagefind otherwise
|
|
PUBLIC_DOCSEARCH_APP_ID: ${{ secrets.DOCSEARCH_APP_ID }}
|
|
PUBLIC_DOCSEARCH_API_KEY: ${{ secrets.DOCSEARCH_API_KEY }}
|
|
PUBLIC_DOCSEARCH_INDEX_NAME: ${{ secrets.DOCSEARCH_INDEX_NAME }}
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
|
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6
|
|
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
|
|
with:
|
|
node-version: 24
|
|
cache: pnpm
|
|
- name: prepare awesome list
|
|
run: |
|
|
make prepare-awesome-latest prepare-awesome\#27 prepare-awesome\#26 prepare-awesome\#25 prepare-awesome\#24 prepare-awesome\#23 prepare-awesome\#22 prepare-awesome-v28
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: build site
|
|
run: make build
|
|
|
|
- name: Copy files to Cloudflare Pages
|
|
env:
|
|
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
run: |
|
|
# cloudflare/_headers and cloudflare/_redirects are only meaningful for
|
|
# the Cloudflare Pages deployment, so they are copied into the build
|
|
# right before the deploy.
|
|
cp cloudflare/_headers sites/docs/dist/_headers
|
|
cp cloudflare/_redirects sites/docs/dist/_redirects
|
|
test -f sites/docs/dist/_headers -a -f sites/docs/dist/_redirects || exit 1
|
|
pnpm dlx wrangler@4 pages deploy sites/docs/dist \
|
|
--project-name docs-gitea-com \
|
|
--branch main
|