continuwuity/.forgejo/workflows/documentation.yml
Jade Ellis 2d9bdc0979
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Failing after 1s
Documentation / Build and Deploy Documentation (push) Has been cancelled
Release Docker Image / define-variables (push) Successful in 3s
Release Docker Image / build-image (linux/amd64, linux-amd64) (push) Successful in 19m59s
Release Docker Image / define-variables (pull_request) Failing after 1s
Release Docker Image / build-image (linux/amd64, linux-amd64) (pull_request) Has been skipped
Release Docker Image / build-image (linux/arm64, linux-arm64) (pull_request) Has been skipped
Release Docker Image / merge (pull_request) Has been skipped
Release Docker Image / build-image (linux/arm64, linux-arm64) (push) Successful in 19m47s
Release Docker Image / merge (push) Successful in 28s
refactor: The update checker has become the announcements checker
Replaces June's endpoint with a continuwuity endpoint.
Adds a JSON schema.

Closes #89
Closes #760
2025-04-20 21:01:29 +01:00

72 lines
2.5 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: not-nexy
steps:
- name: Sync repository
uses: https://github.com/actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
- name: Setup mdBook
uses: https://github.com/peaceiris/actions-mdbook@v2
with:
mdbook-version: "latest"
- name: Build mdbook
run: mdbook build
- name: Prepare static files for deployment
run: |
mkdir -p ./public/.well-known/matrix
mkdir -p ./public/.well-known/continuwuity
mkdir -p ./public/schema
# Copy the Matrix .well-known files
cp ./docs/static/server ./public/.well-known/matrix/server
cp ./docs/static/client ./public/.well-known/matrix/client
cp ./docs/static/announcements.json ./public/.well-known/continuwuity/announcements
cp ./docs/static/announcements.schema.json ./public/schema/announcements.schema.json
# Copy the custom headers file
cp ./docs/static/_headers ./public/_headers
echo "Copied .well-known files and _headers to ./public"
- name: Setup Node.js
uses: https://github.com/actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm install --save-dev wrangler@latest
- name: Deploy to Cloudflare Pages (Production)
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: https://github.com/cloudflare/wrangler-action@v3
with:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
command: pages deploy ./public --branch=main --commit-dirty=true --project-name=${{ vars.CLOUDFLARE_PROJECT_NAME }}"
- name: Deploy to Cloudflare Pages (Preview)
if: ${{ github.event_name != 'push' || github.ref != 'refs/heads/main' }}
uses: https://github.com/cloudflare/wrangler-action@v3
with:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
command: pages deploy ./public --branch=${{ github.head_ref }} --commit-dirty=true --project-name=${{ vars.CLOUDFLARE_PROJECT_NAME }}"