mirror of
https://gitea.com/gitea/docs.git
synced 2026-11-18 15:53:50 +00:00
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-26.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@949feb2413d6458794dcd2491c4babbbce0c15c1 # 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
|