34 lines
921 B
YAML
34 lines
921 B
YAML
name: Docs
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
branches: [ master ]
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: pages
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: node22
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: ./.forgejo/actions/init
|
|
- name: Build docs
|
|
run: |
|
|
pnpm run docs
|
|
touch docs/.nojekyll
|
|
echo "ref.mtcute.dev" > docs/CNAME
|
|
echo "ignore-workspace-root-check=true" >> .npmrc
|
|
- name: Deploy
|
|
# do not run on forks and releases
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.actor == 'desu-bot'
|
|
uses: https://github.com/cloudflare/wrangler-action@v3
|
|
with:
|
|
apiToken: ${{ secrets.CLOUDFLARE_PAGES_TOKEN }}
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
command: pages deploy docs --project-name=mtcute-apiref
|